summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-03-10 09:34:24 -0600
committerDan McGee <dan@archlinux.org>2011-03-10 09:35:35 -0600
commit3e73b5d7d291b20858b18ba7492b7f92501e01c7 (patch)
tree6f1d0ac34c0ab66973a0b1361a90a91307218d06
parent6a429a8d898d5f0789f5b5a3f2858c6578fa5227 (diff)
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 <dan@archlinux.org>
-rw-r--r--settings.py9
1 files changed, 9 insertions, 0 deletions
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: