summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorTai Lee <tai.lee@3030.com.au>2013-07-31 17:11:49 +1000
committerTai Lee <tai.lee@3030.com.au>2013-07-31 18:58:50 +1000
commit4c6ffcf721b9a36b9b7e4730f4f4716cc90a5f02 (patch)
tree7f870dfa5bba6badfdf500cdaf68b1d252ce6e06 /docs
parent5154c9f92caa38bd5893320ed72fbc7305233822 (diff)
Fixed #20819 -- Return 404 instead of 500 error when ``staticfiles`` view is used in production.
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/contrib/staticfiles.txt6
-rw-r--r--docs/releases/1.7.txt8
2 files changed, 14 insertions, 0 deletions
diff --git a/docs/ref/contrib/staticfiles.txt b/docs/ref/contrib/staticfiles.txt
index 678ab32a05..7b9a2048b5 100644
--- a/docs/ref/contrib/staticfiles.txt
+++ b/docs/ref/contrib/staticfiles.txt
@@ -350,6 +350,12 @@ This view function serves static files in development.
**insecure**. This is only intended for local development, and should
**never be used in production**.
+.. versionchanged:: 1.7
+
+ Will now raise an :exc:`~django.http.Http404` exception instead of
+ :exc:`~from django.core.exceptions.ImproperlyConfigured` when
+ :setting:`DEBUG` is ``True``.
+
.. note::
To guess the served files' content types, this view relies on the
diff --git a/docs/releases/1.7.txt b/docs/releases/1.7.txt
index 217fdff287..0d6a3fefdc 100644
--- a/docs/releases/1.7.txt
+++ b/docs/releases/1.7.txt
@@ -122,6 +122,14 @@ Miscellaneous
* Loading empty fixtures emits a ``RuntimeWarning`` rather than raising
:class:`~django.core.management.CommandError`.
+* :view:`~django.contrib.staticfiles.views.serve` will now raise an
+ :exc:`~django.http.Http404` exception instead of
+ :exc:`~from django.core.exceptions.ImproperlyConfigured` when :setting:`DEBUG`
+ is ``True``. This change removes the need to conditionally add the view to
+ your root URLconf, which in turn makes it safe to reverse by name. It also
+ removes the ability for visitors to generate spurious HTTP 500 errors by
+ requesting static files that don't exist or haven't been collected yet.
+
Features deprecated in 1.7
==========================