Fixed #29324 -- Made SECRET_KEY validation lazy (on first access).

This commit is contained in:
Florian Apolloner 2020-07-29 09:06:54 +02:00 committed by GitHub
parent 9c9a3fe118
commit 948a874425
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 26 additions and 17 deletions

View file

@ -272,7 +272,13 @@ Requests and Responses
Security
~~~~~~~~
* ...
* The :setting:`SECRET_KEY` setting is now checked for a valid value upon first
access, rather than when settings are first loaded. This enables running
management commands that do not rely on the ``SECRET_KEY`` without needing to
provide a value. As a consequence of this, calling
:func:`~django.conf.settings.configure` without providing a valid
``SECRET_KEY``, and then going on to access ``settings.SECRET_KEY`` will now
raise an :exc:`~django.core.exceptions.ImproperlyConfigured` exception.
Serialization
~~~~~~~~~~~~~