Skip to content

Developer guide: Enabling Django Debug Toolbar

drkitty edited this page Feb 26, 2015 · 1 revision

In settings.local, be sure that 'debug_toolbar.middleware.DebugToolbarMiddleware' is in your MIDDLEWARE_CLASSES. The other config stuff should already be included, but just to be safe you might check that the following code is in your settings.local.

def custom_show_toolbar(request):
    # Always show toolbar, for example purposes only.
    return True
DEBUG_TOOLBAR_PANELS = (
    'debug_toolbar.panels.version.VersionDebugPanel',
    'debug_toolbar.panels.timer.TimerDebugPanel',
    'debug_toolbar.panels.settings_vars.SettingsVarsDebugPanel',
    'debug_toolbar.panels.headers.HeaderDebugPanel',
    'debug_toolbar.panels.request_vars.RequestVarsDebugPanel',
    'debug_toolbar.panels.template.TemplateDebugPanel',
    'debug_toolbar.panels.sql.SQLDebugPanel',
    'debug_toolbar.panels.signals.SignalDebugPanel',
    'debug_toolbar.panels.logger.LoggingPanel',
    'debug_toolbar.panels.profiling.ProfilingDebugPanel',
)
DEBUG_TOOLBAR_CONFIG = {
    'INTERCEPT_REDIRECTS': False,
    'SHOW_TOOLBAR_CALLBACK': custom_show_toolbar,
    'HIDE_DJANGO_SQL': False,
    'ENABLE_STACKTRACES' : True,
}