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:
parent
6a429a8d89
commit
3e73b5d7d2
@ -4,6 +4,7 @@
|
|||||||
## Set the debug values
|
## Set the debug values
|
||||||
DEBUG = False
|
DEBUG = False
|
||||||
TEMPLATE_DEBUG = DEBUG
|
TEMPLATE_DEBUG = DEBUG
|
||||||
|
DEBUG_TOOLBAR = False
|
||||||
|
|
||||||
## Notification admins
|
## Notification admins
|
||||||
ADMINS = ()
|
ADMINS = ()
|
||||||
@ -121,4 +122,12 @@
|
|||||||
('django.template.loaders.cached.Loader', TEMPLATE_LOADERS),
|
('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:
|
# vim: set ts=4 sw=4 et:
|
||||||
|
Loading…
Reference in New Issue
Block a user