Mercurial > public > bravenewsurf
changeset 11:d5f3bb516fd3
For issue #4, add support for the Django Debug Toolbar if in debug mode.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sun, 30 Oct 2011 14:51:12 -0500 |
parents | 01740aa4a6b9 |
children | 55e1d68da925 |
files | bns_website/settings/local.py |
diffstat | 1 files changed, 13 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/bns_website/settings/local.py Sat Oct 29 22:38:18 2011 -0500 +++ b/bns_website/settings/local.py Sun Oct 30 14:51:12 2011 -0500 @@ -62,3 +62,16 @@ 'handlers': ['file'], }, } + +# Django Debug Toolbar support +if DEBUG: + try: + import debug_toolbar + except ImportError: + pass + else: + i = MIDDLEWARE_CLASSES.index('django.middleware.common.CommonMiddleware') + MIDDLEWARE_CLASSES.insert(i + 1, + 'debug_toolbar.middleware.DebugToolbarMiddleware') + INTERNAL_IPS = ['127.0.0.1'] + INSTALLED_APPS.append('debug_toolbar')