tweak django debug toolbar panels and add djdt_flamegraph

This commit is contained in:
Nick Sweeting 2021-02-16 15:50:39 -05:00
parent 1e2188517b
commit c24e4bf11d
2 changed files with 20 additions and 1 deletions

View file

@ -60,7 +60,25 @@ if DEBUG_TOOLBAR:
INTERNAL_IPS = ['0.0.0.0', '127.0.0.1', '*']
DEBUG_TOOLBAR_CONFIG = {
"SHOW_TOOLBAR_CALLBACK": lambda request: True,
"RENDER_PANELS": True,
}
DEBUG_TOOLBAR_PANELS = [
'debug_toolbar.panels.history.HistoryPanel',
'debug_toolbar.panels.versions.VersionsPanel',
'debug_toolbar.panels.timer.TimerPanel',
'debug_toolbar.panels.settings.SettingsPanel',
'debug_toolbar.panels.headers.HeadersPanel',
'debug_toolbar.panels.request.RequestPanel',
'debug_toolbar.panels.sql.SQLPanel',
'debug_toolbar.panels.staticfiles.StaticFilesPanel',
# 'debug_toolbar.panels.templates.TemplatesPanel',
'debug_toolbar.panels.cache.CachePanel',
'debug_toolbar.panels.signals.SignalsPanel',
'debug_toolbar.panels.logging.LoggingPanel',
'debug_toolbar.panels.redirects.RedirectsPanel',
'debug_toolbar.panels.profiling.ProfilingPanel',
'djdt_flamegraph.FlamegraphPanel',
]
MIDDLEWARE = [
@ -72,7 +90,7 @@ MIDDLEWARE = [
'django.contrib.messages.middleware.MessageMiddleware',
]
if DEBUG_TOOLBAR:
MIDDLEWARE = ['debug_toolbar.middleware.DebugToolbarMiddleware', *MIDDLEWARE]
MIDDLEWARE = [*MIDDLEWARE, 'debug_toolbar.middleware.DebugToolbarMiddleware']
AUTHENTICATION_BACKENDS = [
'django.contrib.auth.backends.ModelBackend',

View file

@ -66,6 +66,7 @@ EXTRAS_REQUIRE = {
"bottle",
"stdeb",
"django-debug-toolbar",
"djdt_flamegraph",
],
}