From a2043029107a2a685c5d25a324de68dc9dc24469 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Wed, 9 Dec 2020 16:04:45 +0100 Subject: [PATCH] Disable all debug toolbar panels by default (cuts down 80% of request time locally) --- src/pretix/settings.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/pretix/settings.py b/src/pretix/settings.py index bbc38c800..cd651cfd7 100644 --- a/src/pretix/settings.py +++ b/src/pretix/settings.py @@ -374,10 +374,16 @@ MIDDLEWARE = [ ] try: - import debug_toolbar # noqa + import debug_toolbar.settings # noqa if DEBUG: INSTALLED_APPS.append('debug_toolbar.apps.DebugToolbarConfig') MIDDLEWARE.insert(0, 'debug_toolbar.middleware.DebugToolbarMiddleware') + DEBUG_TOOLBAR_PATCH_SETTINGS = False + DEBUG_TOOLBAR_CONFIG = { + 'JQUERY_URL': '', + 'DISABLE_PANELS': debug_toolbar.settings.PANELS_DEFAULTS, + } + pass except ImportError: pass @@ -561,14 +567,6 @@ COMPRESS_CSS_FILTERS = ( 'compressor.filters.cssmin.CSSCompressorFilter', ) -# Debug toolbar -DEBUG_TOOLBAR_PATCH_SETTINGS = False - - -DEBUG_TOOLBAR_CONFIG = { - 'JQUERY_URL': '', -} - INTERNAL_IPS = ('127.0.0.1', '::1') MESSAGE_TAGS = {