aboutsummaryrefslogtreecommitdiffstats
path: root/debug_toolbar/models.py
diff options
context:
space:
mode:
authorAymeric Augustin2013-11-30 13:38:57 +0100
committerAymeric Augustin2013-11-30 13:48:30 +0100
commit0200fc14a38be5d0bac9e5fe9484d585ffa76921 (patch)
tree49bc797da8a50b64ae70bae3050fa6587033202f /debug_toolbar/models.py
parentdc04efa74316676ff73330b01e79b2debae1df9f (diff)
downloaddjango-debug-toolbar-0200fc14a38be5d0bac9e5fe9484d585ffa76921.tar.bz2
Provide a solution to prevent monkey-patching the settings.
This is necessary to work around extreme cases of circular imports. We really need to reverse URLs at import time and this isn't always possible.
Diffstat (limited to 'debug_toolbar/models.py')
-rw-r--r--debug_toolbar/models.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/debug_toolbar/models.py b/debug_toolbar/models.py
index 2db10b8..c9a12d8 100644
--- a/debug_toolbar/models.py
+++ b/debug_toolbar/models.py
@@ -6,6 +6,7 @@ from django.core.urlresolvers import clear_url_caches, reverse, NoReverseMatch
from django.utils.importlib import import_module
import debug_toolbar
+from debug_toolbar import settings as dt_settings
from debug_toolbar.middleware import DebugToolbarMiddleware
@@ -56,7 +57,7 @@ def patch_root_urlconf():
clear_url_caches()
-if settings.DEBUG:
+if dt_settings.PATCH_SETTINGS:
patch_internal_ips()
patch_middleware_classes()
patch_root_urlconf()