From b21269532cbd23ab61f6c80951fae89b18675804 Mon Sep 17 00:00:00 2001 From: Gavin Wahl Date: Wed, 11 Dec 2013 17:28:35 -0700 Subject: Put debug_toolbar's url patterns first Some applications require using a catch-all urlpattern that must come last in the list of urlpatterns. If the __debug__ urls come after it, they'll never be hit. Putting the debug_toolbar urls first fixes this, but could possibly shadow an existing url, but the old version of debug toolbar did the same thing. --- debug_toolbar/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'debug_toolbar/models.py') diff --git a/debug_toolbar/models.py b/debug_toolbar/models.py index c9a12d8..4e624fa 100644 --- a/debug_toolbar/models.py +++ b/debug_toolbar/models.py @@ -51,9 +51,9 @@ def patch_root_urlconf(): reverse('djdt:render_panel') except NoReverseMatch: urlconf_module = import_module(settings.ROOT_URLCONF) - urlconf_module.urlpatterns += patterns('', # noqa + urlconf_module.urlpatterns = patterns('', # noqa url(r'^__debug__/', include(debug_toolbar.urls)), - ) + ) + urlconf_module.urlpatterns clear_url_caches() -- cgit v1.2.3