Kaydet (Commit) a5d3e0c3 authored tarafından Jacob Kaplan-Moss's avatar Jacob Kaplan-Moss

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

Fixed #3187 -- Django will now look for the root URLconf as an attribute 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
üst 86870e75
......@@ -60,7 +60,10 @@ class BaseHandler(object):
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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment