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:
@@ -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
14
common/lib/check_debug.py
Normal 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', ''))
|
||||
@@ -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 #################################
|
||||
|
||||
Reference in New Issue
Block a user