diff options
author | Claude Paroz <claude@2xlibre.net> | 2018-04-25 10:35:54 +0200 |
---|---|---|
committer | Claude Paroz <claude@2xlibre.net> | 2018-04-25 10:38:13 +0200 |
commit | a9189d27efccdee0b5e8b84f69f9041176055769 (patch) | |
tree | eebcbb05d8c18bcf93ed9d584945c35de49bc77c /django | |
parent | c591bc3ccece1514d6b419826c7fa36ada9d9213 (diff) | |
download | django-a9189d27efccdee0b5e8b84f69f9041176055769.tar.gz |
Fixed #29353 -- Made StaticFilesHandler return a 404 response when settings.DEBUG is False
Diffstat (limited to 'django')
-rw-r--r-- | django/contrib/staticfiles/handlers.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/django/contrib/staticfiles/handlers.py b/django/contrib/staticfiles/handlers.py index 2ec6d07d71..0c85c1ce40 100644 --- a/django/contrib/staticfiles/handlers.py +++ b/django/contrib/staticfiles/handlers.py @@ -4,6 +4,7 @@ from urllib.request import url2pathname from django.conf import settings from django.contrib.staticfiles import utils from django.contrib.staticfiles.views import serve +from django.core.handlers.exception import response_for_exception from django.core.handlers.wsgi import WSGIHandler, get_path_info @@ -59,6 +60,7 @@ class StaticFilesHandler(WSGIHandler): if settings.DEBUG: from django.views import debug return debug.technical_404_response(request, e) + return response_for_exception(request, e) return super().get_response(request) def __call__(self, environ, start_response): |