Chapter 31 · 10 min read
Snippet 10
Snippet 10
Read this part of a settings file prepared for production.
import os
SECRET_KEY = os.environ["DJANGO_SECRET_KEY"]
DEBUG = os.environ.get("DJANGO_DEBUG") == "1"
ALLOWED_HOSTS = ["example.com"]
SECURE_SSL_REDIRECT = not DEBUG
STATIC_ROOT = BASE_DIR / "staticfiles"
