aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAymeric Augustin2013-11-13 20:21:00 +0100
committerAymeric Augustin2013-11-13 20:21:00 +0100
commitdc136eaceda6b689303e069f54c2dbc220c27854 (patch)
tree77784c7dada5b6fa0e6c6fa1a4b5b7401454ab5a
parent1062d9cf878b4bdc6f0e0f6434668cd7eb289998 (diff)
downloaddjango-debug-toolbar-dc136eaceda6b689303e069f54c2dbc220c27854.tar.bz2
Clear urlresolver caches after monkey-patching URLconf.
-rw-r--r--debug_toolbar/models.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/debug_toolbar/models.py b/debug_toolbar/models.py
index ef1d012..2152627 100644
--- a/debug_toolbar/models.py
+++ b/debug_toolbar/models.py
@@ -2,7 +2,8 @@ from __future__ import unicode_literals
from django.conf import settings
from django.conf.urls import include, patterns, url
-from django.core.urlresolvers import reverse, NoReverseMatch
+from django.core.urlresolvers import (
+ reverse, NoReverseMatch, _resolver_cache, _ns_resolver_cache)
from django.utils.importlib import import_module
import debug_toolbar
@@ -53,6 +54,8 @@ def patch_root_urlconf():
urlconf_module.urlpatterns += patterns('', # noqa
url(r'^__debug__/', include(debug_toolbar.urls)),
)
+ _resolver_cache.clear()
+ _ns_resolver_cache.clear()
if settings.DEBUG: