Skip to content

Instantly share code, notes, and snippets.

@AlTosterino
Created January 11, 2020 18:59
Show Gist options
  • Save AlTosterino/1419ea240afde561718e9ac9931eec27 to your computer and use it in GitHub Desktop.
Save AlTosterino/1419ea240afde561718e9ac9931eec27 to your computer and use it in GitHub Desktop.
Hiding settings variables in Django debug page
import re
from django.views import debug
HIDDEN_DEFAULT = 'API|TOKEN|KEY|SECRET|PASS|'
debug.HIDDEN_SETTINGS = re.compile(
f'{HIDDEN_DEFAULT}ADDED_NAME|ANOTHER_ADDED_NAME',
flags=re.IGNORECASE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment