Code

Ticket #3187: urlconf.diff

File urlconf.diff, 684 bytes (added by Fredrik Lundh <fredrik@…>, 7 years ago)
Line 
1Index: django/core/handlers/base.py
2===================================================================
3--- django/core/handlers/base.py        (revision 4234)
4+++ django/core/handlers/base.py        (working copy)
5@@ -60,7 +60,10 @@
6             if response:
7                 return response
8 
9-        resolver = urlresolvers.RegexURLResolver(r'^/', settings.ROOT_URLCONF)
10+        # Get urlconf from request object, if available.  Otherwise use default.
11+        urlconf = getattr(request, "urlconf", settings.ROOT_URLCONF)
12+
13+        resolver = urlresolvers.RegexURLResolver(r'^/', urlconf)
14         try:
15             callback, callback_args, callback_kwargs = resolver.resolve(request.path)
16