Merge pull request #2627 from edx/dcs/fix-devstack-toolbar

Fixes devstack settings to work with new version of debug toolbar
This commit is contained in:
Dave St.Germain
2014-02-18 14:55:18 -05:00
3 changed files with 17 additions and 2 deletions

View File

@@ -54,7 +54,8 @@ DEBUG_TOOLBAR_PANELS = (
)
DEBUG_TOOLBAR_CONFIG = {
'INTERCEPT_REDIRECTS': False
'INTERCEPT_REDIRECTS': False,
'SHOW_TOOLBAR_CALLBACK': 'check_debug.should_show_debug_toolbar',
}
# To see stacktraces for MongoDB queries, set this to True.

14
common/lib/check_debug.py Normal file
View File

@@ -0,0 +1,14 @@
"""
Function to check debug status.
"""
import os
def should_show_debug_toolbar(request):
"""
Return True/False to determine whether to show the Django
Debug Toolbar.
If HIDE_TOOLBAR is set in the process environment, the
toolbar will be hidden.
"""
return not bool(os.getenv('HIDE_TOOLBAR', ''))

View File

@@ -53,7 +53,7 @@ DEBUG_TOOLBAR_PANELS = (
DEBUG_TOOLBAR_CONFIG = {
'INTERCEPT_REDIRECTS': False,
'SHOW_TOOLBAR_CALLBACK': lambda _: True,
'SHOW_TOOLBAR_CALLBACK': 'check_debug.should_show_debug_toolbar',
}
########################### PIPELINE #################################