We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 27ec5ae + 226d50a commit ed24438Copy full SHA for ed24438
1 file changed
config/settings.py
@@ -21,14 +21,14 @@
21
# See https://docs.djangoproject.com/en/5.0/howto/deployment/checklist/
22
23
# SECURITY WARNING: keep the secret key used in production secret!
24
-SECRET_KEY = os.getenv(
25
- "DJANGO_SECRET_KEY",
26
- "django-insecure-w^mv=r_(x-se8p#@i*dxfu1^*8$fci+116it+fkj*nx!o2h*r1",
27
-)
+SECRET_KEY = os.getenv("DJANGO_SECRET_KEY")
+assert SECRET_KEY, "DJANGO_SECRET_KEY env variable is required"
28
# SECURITY WARNING: don't run with debug turned on in production!
29
DEBUG = os.getenv("DJANGO_DEBUG", "False").lower() == "true"
30
31
ALLOWED_HOSTS = os.getenv("DJANGO_HOSTS", "*").split(",")
+if ALLOWED_HOSTS[0] != "*":
+ CSRF_TRUSTED_ORIGINS = [f"https://{host}" for host in ALLOWED_HOSTS]
32
33
34
# Application definition
0 commit comments