aboutsummaryrefslogtreecommitdiffstats
path: root/debug_toolbar/settings.py
diff options
context:
space:
mode:
authortschilling2014-02-14 13:56:50 -0500
committertschilling2014-02-14 14:17:26 -0500
commit1a5108a23d97f2c6d111afaff433df64c2211955 (patch)
tree9025b420606438078ca792be2ecafd64d78433c3 /debug_toolbar/settings.py
parent06c3824c031d19013a4db8f844c503ab8e6b80ea (diff)
downloaddjango-debug-toolbar-1a5108a23d97f2c6d111afaff433df64c2211955.tar.bz2
Deprecating INTERCEPT_REDIRECTS in favor of DEFAULT_DISABLED_PANELS.
Diffstat (limited to 'debug_toolbar/settings.py')
-rw-r--r--debug_toolbar/settings.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/debug_toolbar/settings.py b/debug_toolbar/settings.py
index 48649fd..2d02aa5 100644
--- a/debug_toolbar/settings.py
+++ b/debug_toolbar/settings.py
@@ -16,6 +16,7 @@ from django.utils import six
CONFIG_DEFAULTS = {
# Toolbar options
+ 'DEFAULT_DISABLED_PANELS': ('RedirectsPanel', ),
'INSERT_BEFORE': '</body>',
'RENDER_PANELS': None,
'RESULTS_STORE_SIZE': 10,
@@ -32,7 +33,6 @@ CONFIG_DEFAULTS = {
'debug_toolbar',
'django',
),
- 'INTERCEPT_REDIRECTS': False,
'SHOW_TEMPLATE_CONTEXT': True,
'SQL_WARNING_THRESHOLD': 500, # milliseconds
}
@@ -125,6 +125,23 @@ else:
PANELS[index] = new_panel
+if 'INTERCEPT_REDIRECTS' in USER_CONFIG:
+ warnings.warn(
+ "INTERCEPT_REDIRECTS is deprecated. Please use the "
+ "DEFAULT_DISABLED_PANELS config in the"
+ "DEBUG_TOOLBAR_CONFIG setting.", DeprecationWarning)
+ if USER_CONFIG['INTERCEPT_REDIRECTS']:
+ if 'RedirectsPanel' in CONFIG['DEFAULT_DISABLED_PANELS']:
+ # RedirectsPanel should be enabled
+ CONFIG['DEFAULT_DISABLED_PANELS'] = [
+ panel for panel in CONFIG['DEFAULT_DISABLED_PANELS']
+ if panel != "RedirectsPanel"
+ ]
+ elif not 'RedirectsPanel' in CONFIG['DEFAULT_DISABLED_PANELS']:
+ # RedirectsPanel should be disabled
+ CONFIG['DEFAULT_DISABLED_PANELS'].append('RedirectsPanel')
+
+
PATCH_SETTINGS = getattr(settings, 'DEBUG_TOOLBAR_PATCH_SETTINGS', settings.DEBUG)