Skip to content

Commit b212695

Browse files
committed
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.
1 parent 7716a53 commit b212695

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

debug_toolbar/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ def patch_root_urlconf():
5151
reverse('djdt:render_panel')
5252
except NoReverseMatch:
5353
urlconf_module = import_module(settings.ROOT_URLCONF)
54-
urlconf_module.urlpatterns += patterns('', # noqa
54+
urlconf_module.urlpatterns = patterns('', # noqa
5555
url(r'^__debug__/', include(debug_toolbar.urls)),
56-
)
56+
) + urlconf_module.urlpatterns
5757
clear_url_caches()
5858

5959

0 commit comments

Comments
 (0)