Skip to content

Commit 0e301e3

Browse files
committed
We actually don't need to copy the debug toolbar urlconf.
1 parent d7a1124 commit 0e301e3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

debug_toolbar/middleware.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,15 @@ def process_request(self, request):
7676
urlconf_name = getattr(request, 'urlconf', settings.ROOT_URLCONF)
7777
if urlconf_name not in self._urlconfs:
7878

79-
import imp, copy
79+
import imp
8080

8181
original_urlconf = __import__(getattr(request, 'urlconf', settings.ROOT_URLCONF), {}, {}, ['*'])
8282
new_urlconf = imp.new_module('urlconf')
83-
new_urlconf.urlpatterns = copy.copy(debug_toolbar.urls.urlpatterns)
83+
new_urlconf.urlpatterns = debug_toolbar.urls.urlpatterns + \
84+
patterns('',
85+
('', include(original_urlconf)),
86+
)
8487

85-
new_urlconf.urlpatterns += patterns('',
86-
('', include(original_urlconf)),
87-
)
8888
if hasattr(original_urlconf, 'handler404'):
8989
new_urlconf.handler404 = original_urlconf.handler404
9090
if hasattr(original_urlconf, 'handler500'):

0 commit comments

Comments
 (0)