Fixed #34140 -- Reformatted code blocks in docs with blacken-docs.

This commit is contained in:
django-bot 2023-02-28 20:53:28 +01:00 committed by Mariusz Felisiak
parent 6015bab80e
commit 14459f80ee
193 changed files with 5797 additions and 4481 deletions

View file

@ -52,19 +52,21 @@ Instead of hardcoding the secret key in your settings module, consider loading
it from an environment variable::
import os
SECRET_KEY = os.environ['SECRET_KEY']
SECRET_KEY = os.environ["SECRET_KEY"]
or from a file::
with open('/etc/secret_key.txt') as f:
with open("/etc/secret_key.txt") as f:
SECRET_KEY = f.read().strip()
If rotating secret keys, you may use :setting:`SECRET_KEY_FALLBACKS`::
import os
SECRET_KEY = os.environ['CURRENT_SECRET_KEY']
SECRET_KEY = os.environ["CURRENT_SECRET_KEY"]
SECRET_KEY_FALLBACKS = [
os.environ['OLD_SECRET_KEY'],
os.environ["OLD_SECRET_KEY"],
]
Ensure that old secret keys are removed from ``SECRET_KEY_FALLBACKS`` in a