Skip to content
Browse files

Fixed #3187 -- Django will now look for the root URLconf as an attrib…

…ute of the request object, if available. This lets middleware override the urlconf as needed. Thanks, Fredrik Lundh.

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 86870e7 commit a5d3e0c3ef8975bfc8ab5bd4c13c27edab43b86b @jacobian jacobian committed
Showing with 4 additions and 1 deletion.
  1. +4 −1 django/core/handlers/
5 django/core/handlers/
@@ -60,7 +60,10 @@ def get_response(self, request):
if response:
return response
- resolver = urlresolvers.RegexURLResolver(r'^/', settings.ROOT_URLCONF)
+ # Get urlconf from request object, if available. Otherwise use default.
+ urlconf = getattr(request, "urlconf", settings.ROOT_URLCONF)
+ resolver = urlresolvers.RegexURLResolver(r'^/', urlconf)
callback, callback_args, callback_kwargs = resolver.resolve(request.path)

0 comments on commit a5d3e0c

Please sign in to comment.
Something went wrong with that request. Please try again.