Code

Ticket #14200: memoize.urlresolver.diff

File memoize.urlresolver.diff, 1.1 KB (added by Suor, 4 years ago)
Line 
1Index: django/core/handlers/base.py
2===================================================================
3--- django/core/handlers/base.py        (revision 13679)
4+++ django/core/handlers/base.py        (working copy)
5@@ -73,7 +73,7 @@
6                 # Setup default url resolver for this thread.
7                 urlconf = settings.ROOT_URLCONF
8                 urlresolvers.set_urlconf(urlconf)
9-                resolver = urlresolvers.RegexURLResolver(r'^/', urlconf)
10+                resolver = urlresolvers.get_resolver(urlconf)
11 
12                 # Apply request middleware
13                 for middleware_method in self._request_middleware:
14@@ -85,7 +85,7 @@
15                     # Reset url resolver with a custom urlconf.
16                     urlconf = request.urlconf
17                     urlresolvers.set_urlconf(urlconf)
18-                    resolver = urlresolvers.RegexURLResolver(r'^/', urlconf)
19+                    resolver = urlresolvers.get_resolver(urlconf)
20 
21                 callback, callback_args, callback_kwargs = resolver.resolve(
22                         request.path_info)