From 3e73b5d7d291b20858b18ba7492b7f92501e01c7 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Thu, 10 Mar 2011 09:34:24 -0600 Subject: Make it very easy to use the Django debug toolbar Add a config option DEBUG_TOOLBAR that defaults to False. If set to True in local_settings, add the relevant application and middleware to the settings to enable it. Signed-off-by: Dan McGee --- settings.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/settings.py b/settings.py index 8e916e36..9565e6c4 100644 --- a/settings.py +++ b/settings.py @@ -4,6 +4,7 @@ import os ## Set the debug values DEBUG = False TEMPLATE_DEBUG = DEBUG +DEBUG_TOOLBAR = False ## Notification admins ADMINS = () @@ -121,4 +122,12 @@ if not TEMPLATE_DEBUG: ('django.template.loaders.cached.Loader', TEMPLATE_LOADERS), ) +# Enable the debug toolbar if requested +if DEBUG_TOOLBAR: + MIDDLEWARE_CLASSES = \ + [ 'debug_toolbar.middleware.DebugToolbarMiddleware' ] + \ + list(MIDDLEWARE_CLASSES) + + INSTALLED_APPS = list(INSTALLED_APPS) + [ 'debug_toolbar' ] + # vim: set ts=4 sw=4 et: -- cgit v1.2.3-55-g3dc8