settings: do not block on missing debug toolbar when DEBUG is True

A message is displayed to the user about the missing debug_toolbar module.
This commit is contained in:
Benjamin Dauvergne 2013-03-05 14:21:29 +01:00
parent 5f0f35b16a
commit 3529f17080
2 changed files with 6 additions and 2 deletions

View File

@ -328,8 +328,12 @@ except ImportError, e:
pass
if USE_DEBUG_TOOLBAR:
MIDDLEWARE_CLASSES += ('debug_toolbar.middleware.DebugToolbarMiddleware',)
INSTALLED_APPS += ('debug_toolbar',)
try:
import debug_toolbar
MIDDLEWARE_CLASSES += ('debug_toolbar.middleware.DebugToolbarMiddleware',)
INSTALLED_APPS += ('debug_toolbar',)
except ImportError:
print "Debug toolbar missing, not loaded"
if AUTH_SAML2:
INSTALLED_APPS += ('authentic2.authsaml2',)