diff options
| author | Aymeric Augustin | 2013-11-12 22:05:52 +0100 | 
|---|---|---|
| committer | Aymeric Augustin | 2013-11-12 22:15:50 +0100 | 
| commit | f48039e3bad9e24a59a25ed5636b428e11784da9 (patch) | |
| tree | dbb6471cbf1ceb504d9932639b3ca40a57b89a31 /debug_toolbar/middleware.py | |
| parent | c1d50fc79645c71987ae156d371777dd371c422d (diff) | |
| download | django-debug-toolbar-f48039e3bad9e24a59a25ed5636b428e11784da9.tar.bz2 | |
Move the logic to load panels inside the DebugToolbar class.
This has the additional advantage of eliminating a side-effect that
happened at import time unnecessarily.
It justified refactoring the way we handle settings and defaults.
Diffstat (limited to 'debug_toolbar/middleware.py')
| -rw-r--r-- | debug_toolbar/middleware.py | 6 | 
1 files changed, 3 insertions, 3 deletions
| diff --git a/debug_toolbar/middleware.py b/debug_toolbar/middleware.py index 80e8ae0..44d0700 100644 --- a/debug_toolbar/middleware.py +++ b/debug_toolbar/middleware.py @@ -12,7 +12,7 @@ from django.shortcuts import render  from django.utils.encoding import force_text  from debug_toolbar.toolbar import DebugToolbar -from debug_toolbar.utils.settings import CONFIG +from debug_toolbar.utils import settings as dt_settings  _HTML_TYPES = ('text/html', 'application/xhtml+xml')  # Handles python threading module bug - http://bugs.python.org/issue14308 @@ -52,10 +52,10 @@ class DebugToolbarMiddleware(object):      def __init__(self):          # The method to call to decide to show the toolbar -        self.show_toolbar = CONFIG['SHOW_TOOLBAR_CALLBACK'] or show_toolbar +        self.show_toolbar = dt_settings.CONFIG['SHOW_TOOLBAR_CALLBACK'] or show_toolbar          # The tag to attach the toolbar to -        self.tag = '</%s>' % CONFIG['TAG'] +        self.tag = '</%s>' % dt_settings.CONFIG['TAG']      def process_request(self, request):          __traceback_hide__ = True                                       # noqa | 
