Skip to content

Instantly share code, notes, and snippets.

@benspaulding
Created September 11, 2013 15:47
Show Gist options
  • Save benspaulding/6525540 to your computer and use it in GitHub Desktop.
Save benspaulding/6525540 to your computer and use it in GitHub Desktop.
# Set internal IPs if necessary, for use with debug toolbar.
try:
INTERNAL_IPS
except NameError:
INTERNAL_IPS = []
INTERNAL_IPS = list(INTERNAL_IPS) + ['127.0.0.1']
# Install and setup debug toolbar if it is available.
try:
__import__('debug_toolbar')
except ImportError:
pass
else:
if 'debug_toolbar' not in INSTALLED_APPS:
INSTALLED_APPS = list(INSTALLED_APPS) + ['debug_toolbar']
MIDDLEWARE_CLASSES = list(MIDDLEWARE_CLASSES) + \
['debug_toolbar.middleware.DebugToolbarMiddleware']
DEBUG_TOOLBAR_CONFIG = {
'INTERCEPT_REDIRECTS': False,
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment