diff --git a/django/contrib/staticfiles/handlers.py b/django/contrib/staticfiles/handlers.py
index bb54db6b..f3939a7f 100644
a
|
b
|
|
1 | 1 | from django.conf import settings |
| 2 | from django.core import urlresolvers |
2 | 3 | from django.core.handlers.wsgi import get_path_info, WSGIHandler |
3 | 4 | from django.utils.six.moves.urllib.parse import urlparse |
4 | 5 | from django.utils.six.moves.urllib.request import url2pathname |
… |
… |
class StaticFilesHandler(WSGIHandler):
|
53 | 54 | if settings.DEBUG: |
54 | 55 | from django.views import debug |
55 | 56 | return debug.technical_404_response(request, e) |
56 | | return super(StaticFilesHandler, self).get_response(request) |
| 57 | else: |
| 58 | urlconf = settings.ROOT_URLCONF |
| 59 | urlresolvers.set_urlconf(urlconf) |
| 60 | resolver = urlresolvers.RegexURLResolver(r'^/', urlconf) |
| 61 | return self.get_exception_response(request, resolver, 404) |
| 62 | else: |
| 63 | return super(StaticFilesHandler, self).get_response(request) |
57 | 64 | |
58 | 65 | def __call__(self, environ, start_response): |
59 | 66 | if not self._should_handle(get_path_info(environ)): |