Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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: http://code.djangoproject.com/svn/django/trunk@4237 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit a5d3e0c3ef8975bfc8ab5bd4c13c27edab43b86b 1 parent 86870e7
Jacob Kaplan-Moss jacobian authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 django/core/handlers/base.py
5 django/core/handlers/base.py
View
@@ -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)
try:
callback, callback_args, callback_kwargs = resolver.resolve(request.path)
Please sign in to comment.
Something went wrong with that request. Please try again.