From c24e4bf11dd297872927f7d83ff59c68f0dda7a0 Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Tue, 16 Feb 2021 15:50:39 -0500 Subject: [PATCH] tweak django debug toolbar panels and add djdt_flamegraph --- archivebox/core/settings.py | 20 +++++++++++++++++++- setup.py | 1 + 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/archivebox/core/settings.py b/archivebox/core/settings.py index 9a5700fc..a8002da9 100644 --- a/archivebox/core/settings.py +++ b/archivebox/core/settings.py @@ -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', diff --git a/setup.py b/setup.py index 0b0615e1..15303f94 100755 --- a/setup.py +++ b/setup.py @@ -66,6 +66,7 @@ EXTRAS_REQUIRE = { "bottle", "stdeb", "django-debug-toolbar", + "djdt_flamegraph", ], }