diff options
| author | Aymeric Augustin | 2013-10-27 12:48:44 +0100 |
|---|---|---|
| committer | Aymeric Augustin | 2013-10-27 12:48:44 +0100 |
| commit | 9cb9796791062c9d208c0f887dc65142d42c022a (patch) | |
| tree | 40ba69bec7f39115ccfcc88c5b1cfa2baf2f86ea /debug_toolbar/toolbar/loader.py | |
| parent | c710140a15222af2cf31b7579c6a5fedf9a482d5 (diff) | |
| download | django-debug-toolbar-9cb9796791062c9d208c0f887dc65142d42c022a.tar.bz2 | |
Centralize access to config and default values.
Diffstat (limited to 'debug_toolbar/toolbar/loader.py')
| -rw-r--r-- | debug_toolbar/toolbar/loader.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/debug_toolbar/toolbar/loader.py b/debug_toolbar/toolbar/loader.py index 491f66c..c8630a9 100644 --- a/debug_toolbar/toolbar/loader.py +++ b/debug_toolbar/toolbar/loader.py @@ -9,6 +9,8 @@ from django.template.loader import render_to_string from django.utils.datastructures import SortedDict from django.utils.importlib import import_module +from debug_toolbar.utils.settings import CONFIG + class DebugToolbar(object): @@ -17,17 +19,14 @@ class DebugToolbar(object): self._panels = SortedDict() base_url = self.request.META.get('SCRIPT_NAME', '') self.config = { - 'INTERCEPT_REDIRECTS': False, 'MEDIA_URL': '%s/__debug__/m/' % base_url, - 'ROOT_TAG_ATTRS': '', } - # Check if settings has a DEBUG_TOOLBAR_CONFIG and updated config - self.config.update(getattr(settings, 'DEBUG_TOOLBAR_CONFIG', {})) + self.config.update(CONFIG) self.template_context = { 'BASE_URL': base_url, # for backwards compatibility - 'DEBUG_TOOLBAR_MEDIA_URL': self.config.get('MEDIA_URL'), + 'DEBUG_TOOLBAR_MEDIA_URL': self.config['MEDIA_URL'], 'STATIC_URL': settings.STATIC_URL, - 'TOOLBAR_ROOT_TAG_ATTRS': self.config.get('ROOT_TAG_ATTRS'), + 'TOOLBAR_ROOT_TAG_ATTRS': self.config['ROOT_TAG_ATTRS'], } self.load_panels() |
