73 | | # Reset the urlconf for this thread. |
74 | | urlresolvers.set_urlconf(None) |
75 | | # Obtain a default resolver. It's needed early for handling 404's. |
76 | | resolver = urlresolvers.RegexURLResolver(r'^/', None) |
| 73 | # Setup default url resolver for this thread. |
| 74 | urlconf = settings.ROOT_URLCONF |
| 75 | urlresolvers.set_urlconf(urlconf) |
| 76 | resolver = urlresolvers.RegexURLResolver(r'^/', urlconf) |
84 | | # Get urlconf from request object, if available. Otherwise use default. |
85 | | urlconf = getattr(request, "urlconf", settings.ROOT_URLCONF) |
86 | | # Set the urlconf for this thread to the one specified above. |
87 | | urlresolvers.set_urlconf(urlconf) |
88 | | # Reset the resolver with a possibly new urlconf |
89 | | resolver = urlresolvers.RegexURLResolver(r'^/', urlconf) |
| 84 | if hasattr(request, "urlconf"): |
| 85 | # Reset url resolver with a custom urlconf. |
| 86 | urlconf = request.urlconf |
| 87 | urlresolvers.set_urlconf(urlconf) |
| 88 | resolver = urlresolvers.RegexURLResolver(r'^/', urlconf) |