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>
This commit is contained in:
Dan McGee 2011-03-10 09:34:24 -06:00
parent 6a429a8d89
commit 3e73b5d7d2

View File

@ -4,6 +4,7 @@
## Set the debug values
DEBUG = False
TEMPLATE_DEBUG = DEBUG
DEBUG_TOOLBAR = False
## Notification admins
ADMINS = ()
@ -121,4 +122,12 @@
('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: