diff options
| author | Aymeric Augustin | 2013-11-16 21:13:21 +0100 | 
|---|---|---|
| committer | Aymeric Augustin | 2013-11-16 21:13:21 +0100 | 
| commit | 715fe284da176618f5cd404665641d67dc6fc875 (patch) | |
| tree | da1df574fdbf67154d69dd6c6fad5f36665fc9b7 /debug_toolbar/settings.py | |
| parent | ac1d552494f0161836139e8065ee0fa58077d796 (diff) | |
| download | django-debug-toolbar-715fe284da176618f5cd404665641d67dc6fc875.tar.bz2 | |
Flat is better than nested.
Diffstat (limited to 'debug_toolbar/settings.py')
| -rw-r--r-- | debug_toolbar/settings.py | 55 | 
1 files changed, 55 insertions, 0 deletions
| diff --git a/debug_toolbar/settings.py b/debug_toolbar/settings.py new file mode 100644 index 0000000..f284c76 --- /dev/null +++ b/debug_toolbar/settings.py @@ -0,0 +1,55 @@ +from __future__ import unicode_literals + +from django.conf import settings +from django.utils import six + + +# Always import this module as follows: +# from debug_toolbar import settings [as dt_settings] + +# Don't import directly CONFIG or PANELs, or you will miss changes performed +# with override_settings in tests. + + +CONFIG_DEFAULTS = { +    'INTERCEPT_REDIRECTS': False, +    'SHOW_TOOLBAR_CALLBACK': None, +    'EXTRA_SIGNALS': [], +    'HIDE_DJANGO_SQL': True, +    'SHOW_TEMPLATE_CONTEXT': True, +    'TAG': 'body', +    'ENABLE_STACKTRACES': True, +    'HIDDEN_STACKTRACE_MODULES': ( +        'socketserver' if six.PY3 else 'SocketServer', +        'threading', +        'wsgiref', +        'debug_toolbar', +    ), +    'ROOT_TAG_ATTRS': '', +    'SQL_WARNING_THRESHOLD': 500,   # milliseconds +    'RESULTS_CACHE_SIZE': 10, +    'RENDER_PANELS': None, +} + + +CONFIG = {} +CONFIG.update(CONFIG_DEFAULTS) +CONFIG.update(getattr(settings, 'DEBUG_TOOLBAR_CONFIG', {})) + + +PANELS_DEFAULTS = ( +    '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.sql.SQLDebugPanel', +    'debug_toolbar.panels.template.TemplateDebugPanel', +    'debug_toolbar.panels.cache.CacheDebugPanel', +    'debug_toolbar.panels.signals.SignalDebugPanel', +    'debug_toolbar.panels.logger.LoggingPanel', +    'debug_toolbar.panels.redirects.InterceptRedirectsPanel', +) + + +PANELS = getattr(settings, 'DEBUG_TOOLBAR_PANELS', PANELS_DEFAULTS) | 
