Use custom SHOW_TOOLBAR_CALLBACK

This commit is contained in:
Jan Dittberner 2018-12-26 14:49:56 +01:00
parent 6a982f8db2
commit 6f5c0a1b7c

View file

@ -373,6 +373,10 @@ GVA_ENVIRONMENT = get_env_variable('GVA_ENVIRONMENT', default='prod')
# See: https://docs.djangoproject.com/en/dev/ref/settings/#static-root
STATIC_ROOT = '/srv/gnuviechadmin/static/'
def show_debug_toolbar(request):
return DEBUG == True and GVA_ENVIRONMENT == 'local'
if GVA_ENVIRONMENT == 'local':
# ######### DEBUG CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settings/#debug
@ -422,9 +426,10 @@ if GVA_ENVIRONMENT == 'local':
'userdbs', 'websites']]))
DEBUG_TOOLBAR_PATCH_SETTINGS = False
DEBUG_TOOLBAR_CONFIG = {
'SHOW_TOOLBAR_CALLBACK': 'gnuviechadmin.settings.show_debug_toolbar',
}
# http://django-debug-toolbar.readthedocs.org/en/latest/installation.html
INTERNAL_IPS = ('127.0.0.1', '10.0.2.2')
# ######### END TOOLBAR CONFIGURATION
elif GVA_ENVIRONMENT == 'test':
PASSWORD_HASHERS = (