diff options
| author | Rob Hudson | 2008-09-12 13:34:39 -0700 | 
|---|---|---|
| committer | Rob Hudson | 2008-09-12 13:34:39 -0700 | 
| commit | ec38c74d20606182d9b9462977e185f0c37e99b2 (patch) | |
| tree | 8c16cbe575b123d7eda0ce60b4562524364e886f /debug_toolbar/toolbar/loader.py | |
| parent | 4056bf7fa4049190f103602d071be99a53846952 (diff) | |
| download | django-debug-toolbar-ec38c74d20606182d9b9462977e185f0c37e99b2.tar.bz2 | |
Moving default list of panels into the loader to skip an install step.  Panel
list can still be overridden with a setting if desired.  Updated README as
well.
Diffstat (limited to 'debug_toolbar/toolbar/loader.py')
| -rw-r--r-- | debug_toolbar/toolbar/loader.py | 18 | 
1 files changed, 16 insertions, 2 deletions
| diff --git a/debug_toolbar/toolbar/loader.py b/debug_toolbar/toolbar/loader.py index 815c7f3..67dcc3e 100644 --- a/debug_toolbar/toolbar/loader.py +++ b/debug_toolbar/toolbar/loader.py @@ -10,15 +10,29 @@ class DebugToolbar(object):          self.panels = []          self.panel_list = []          self.content_list = [] +        # Override this tuple by copying to settings.py as `DEBUG_TOOLBAR_PANELS` +        self.default_panels = ( +            'debug_toolbar.panels.version.VersionDebugPanel', +            'debug_toolbar.panels.timer.TimerDebugPanel', +            'debug_toolbar.panels.headers.HeaderDebugPanel', +            'debug_toolbar.panels.request_vars.RequestVarsDebugPanel', +            'debug_toolbar.panels.sql.SQLDebugPanel', +            'debug_toolbar.panels.cache.CacheDebugPanel', +            'debug_toolbar.panels.template.TemplateDebugPanel', +        )      def load_panels(self):          """ -        Populate debug panel lists from settings.DEBUG_TOOLBAR_PANELS. +        Populate debug panels          """          from django.conf import settings          from django.core import exceptions -        for panel_path in settings.DEBUG_TOOLBAR_PANELS: +        # Check if settings has a DEBUG_TOOLBAR_PANELS, otherwise use default +        if hasattr(settings, 'DEBUG_TOOLBAR_PANELS'): +            self.default_panels = settings.DEBUG_TOOLBAR_PANELS + +        for panel_path in self.default_panels:              try:                  dot = panel_path.rindex('.')              except ValueError: | 
