Ticket #3224: resolver.diff
File resolver.diff, 1.4 KB (added by , 18 years ago) |
---|
-
django/core/urlresolvers.py
224 224 result = reverse_helper(self.regex, *args, **kwargs) 225 225 return result + sub_match 226 226 227 def resolve(path, urlconf=None):227 def get_resolver(urlconf): 228 228 if urlconf is None: 229 229 from django.conf import settings 230 230 urlconf = settings.ROOT_URLCONF 231 231 resolver = RegexURLResolver(r'^/', urlconf) 232 return resolver .resolve(path)232 return resolver 233 233 234 def resolve(path, urlconf=None): 235 return get_resolver(urlconf).resolve(path) 236 234 237 def reverse(viewname, urlconf=None, args=None, kwargs=None): 235 238 args = args or [] 236 239 kwargs = kwargs or {} -
django/core/handlers/base.py
61 61 return response 62 62 63 63 # Get urlconf from request object, if available. Otherwise use default. 64 urlconf = getattr(request, "urlconf", settings.ROOT_URLCONF)64 urlconf = getattr(request, "urlconf", None) 65 65 66 resolver = urlresolvers.RegexURLResolver(r'^/', urlconf) 66 resolver = urlresolvers.get_resolver(urlconf) 67 67 68 try: 68 69 callback, callback_args, callback_kwargs = resolver.resolve(request.path) 69 70