From f48039e3bad9e24a59a25ed5636b428e11784da9 Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Tue, 12 Nov 2013 22:05:52 +0100 Subject: 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. --- debug_toolbar/panels/template.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'debug_toolbar/panels/template.py') diff --git a/debug_toolbar/panels/template.py b/debug_toolbar/panels/template.py index 172765a..d918cd7 100644 --- a/debug_toolbar/panels/template.py +++ b/debug_toolbar/panels/template.py @@ -15,7 +15,7 @@ from django.utils.translation import ugettext_lazy as _ from debug_toolbar.panels import DebugPanel from debug_toolbar.utils.tracking.db import recording, SQLQueryTriggered -from debug_toolbar.utils.settings import CONFIG +from debug_toolbar.utils import settings as dt_settings # Code taken and adapted from Simon Willison and Django Snippets: # http://www.djangosnippets.org/snippets/766/ @@ -140,7 +140,7 @@ class TemplateDebugPanel(DebugPanel): template.origin_name = 'No origin' info['template'] = template # Clean up context for better readability - if CONFIG['SHOW_TEMPLATE_CONTEXT']: + if dt_settings.CONFIG['SHOW_TEMPLATE_CONTEXT']: context_list = template_data.get('context', []) info['context'] = '\n'.join(context_list) template_context.append(info) -- cgit v1.2.3