We should only add the DjDT urls if it is enabled.

This commit is contained in:
Ned Batchelder
2015-08-04 11:01:45 -04:00
parent ceb5655b2d
commit 8476baf4dd
2 changed files with 2 additions and 0 deletions

View File

@@ -190,6 +190,7 @@ if settings.DEBUG:
except ImportError:
pass
if 'debug_toolbar' in settings.INSTALLED_APPS:
import debug_toolbar
urlpatterns += (
url(r'^__debug__/', include(debug_toolbar.urls)),

View File

@@ -708,6 +708,7 @@ if settings.DEBUG:
# in debug mode, allow any template to be rendered (most useful for UX reference templates)
urlpatterns += url(r'^template/(?P<template>.+)$', 'debug.views.show_reference_template'),
if 'debug_toolbar' in settings.INSTALLED_APPS:
import debug_toolbar
urlpatterns += (
url(r'^__debug__/', include(debug_toolbar.urls)),