diff options
| author | Nathan Yergler | 2011-05-17 09:18:36 -0700 |
|---|---|---|
| committer | Nathan Yergler | 2011-05-25 16:23:21 -0700 |
| commit | 4e072062d1e3725e05518ae23231c375deee59cd (patch) | |
| tree | c61186278636955561294c3ef97472d87df72ec3 | |
| parent | a66596e98495b24d878ec47648ba6236d5aba2d9 (diff) | |
| download | django-debug-toolbar-4e072062d1e3725e05518ae23231c375deee59cd.tar.bz2 | |
We actually don't need to copy the debug toolbar urlconf.
| -rw-r--r-- | debug_toolbar/middleware.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/debug_toolbar/middleware.py b/debug_toolbar/middleware.py index 7723857..e7cd97f 100644 --- a/debug_toolbar/middleware.py +++ b/debug_toolbar/middleware.py @@ -76,15 +76,15 @@ class DebugToolbarMiddleware(object): urlconf_name = getattr(request, 'urlconf', settings.ROOT_URLCONF) if urlconf_name not in self._urlconfs: - import imp, copy + import imp original_urlconf = __import__(getattr(request, 'urlconf', settings.ROOT_URLCONF), {}, {}, ['*']) new_urlconf = imp.new_module('urlconf') - new_urlconf.urlpatterns = copy.copy(debug_toolbar.urls.urlpatterns) + new_urlconf.urlpatterns = debug_toolbar.urls.urlpatterns + \ + patterns('', + ('', include(original_urlconf)), + ) - new_urlconf.urlpatterns += patterns('', - ('', include(original_urlconf)), - ) if hasattr(original_urlconf, 'handler404'): new_urlconf.handler404 = original_urlconf.handler404 if hasattr(original_urlconf, 'handler500'): |
