mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
[2.1.x] Reverted "Fixed #29324 -- Made Settings raise ImproperlyConfigured if SECRET_KEY is accessed and not set."
This reverts commitb3cffde555due to a regression and performance concerns. Backport of5cc81cd9ebfrom master
This commit is contained in:
@@ -2074,7 +2074,7 @@ object. See :ref:`how-django-processes-a-request` for details.
|
||||
``SECRET_KEY``
|
||||
--------------
|
||||
|
||||
Default: Not defined
|
||||
Default: ``''`` (Empty string)
|
||||
|
||||
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,9 +2087,7 @@ 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 set to an empty value.
|
||||
:class:`~django.core.exceptions.ImproperlyConfigured` is raised if
|
||||
``SECRET_KEY`` is accessed but not set.
|
||||
Django will refuse to start if :setting:`SECRET_KEY` is not set.
|
||||
|
||||
.. warning::
|
||||
|
||||
@@ -2122,10 +2120,6 @@ 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``
|
||||
|
||||
Reference in New Issue
Block a user