summaryrefslogtreecommitdiff
path: root/docs/ref
diff options
context:
space:
mode:
authorJon Dufresne <jon.dufresne@gmail.com>2018-04-13 13:18:53 -0700
committerTim Graham <timograham@gmail.com>2018-04-17 13:02:05 -0400
commitb3cffde5559c4fa97625512d7ec41a674be26076 (patch)
treeb5ad741522c6ffab550c1d98fa8200d6eb5abd6b /docs/ref
parentfff689ed982c9aeb1402446c4eb91c2fb5a2c832 (diff)
Fixed #29324 -- Made Settings raise ImproperlyConfigured if SECRET_KEY is accessed and not set.
Diffstat (limited to 'docs/ref')
-rw-r--r--docs/ref/settings.txt10
1 files changed, 8 insertions, 2 deletions
diff --git a/docs/ref/settings.txt b/docs/ref/settings.txt
index 3647e60663..635cadc848 100644
--- a/docs/ref/settings.txt
+++ b/docs/ref/settings.txt
@@ -2074,7 +2074,7 @@ object. See :ref:`how-django-processes-a-request` for details.
``SECRET_KEY``
--------------
-Default: ``''`` (Empty string)
+Default: Not defined
A secret key for a particular Django installation. This is used to provide
:doc:`cryptographic signing </topics/signing>`, and should be set to a unique,
@@ -2087,7 +2087,9 @@ Uses of the key shouldn't assume that it's text or bytes. Every use should go
through :func:`~django.utils.encoding.force_text` or
:func:`~django.utils.encoding.force_bytes` to convert it to the desired type.
-Django will refuse to start if :setting:`SECRET_KEY` is not set.
+Django will refuse to start if :setting:`SECRET_KEY` is set to an empty value.
+:class:`~django.core.exceptions.ImproperlyConfigured` is raised if
+``SECRET_KEY`` is accessed but not set.
.. warning::
@@ -2120,6 +2122,10 @@ affect them.
startproject <startproject>` creates a unique ``SECRET_KEY`` for
convenience.
+.. versionchanged:: 2.1
+
+ In older versions, ``SECRET_KEY`` defaults to an empty string.
+
.. setting:: SECURE_BROWSER_XSS_FILTER
``SECURE_BROWSER_XSS_FILTER``