Ticket #6269: bettererrorpage.diff
File bettererrorpage.diff, 1.3 KB (added by , 17 years ago) |
---|
-
base.py
58 58 from django.core import exceptions, urlresolvers 59 59 from django.core.mail import mail_admins 60 60 from django.conf import settings 61 try: 62 # Apply request middleware 63 for middleware_method in self._request_middleware: 64 response = middleware_method(request) 65 if response: 66 return response 61 67 62 # Apply request middleware 63 for middleware_method in self._request_middleware: 64 response = middleware_method(request) 65 if response: 66 return response 68 # Get urlconf from request object, if available. Otherwise use default. 69 urlconf = getattr(request, "urlconf", settings.ROOT_URLCONF) 67 70 68 # Get urlconf from request object, if available. Otherwise use default. 69 urlconf = getattr(request, "urlconf", settings.ROOT_URLCONF) 71 resolver = urlresolvers.RegexURLResolver(r'^/', urlconf) 70 72 71 resolver = urlresolvers.RegexURLResolver(r'^/', urlconf)72 try:73 73 callback, callback_args, callback_kwargs = resolver.resolve(request.path) 74 74 75 75 # Apply view middleware