finally solved the csrf bug thing omg

This commit is contained in:
Walter 2025-02-21 03:22:17 +01:00
parent dbd8425fc7
commit 3e275180cc
3 changed files with 3 additions and 1 deletions

View File

@ -1,4 +1,5 @@
DJANGO_ALLOWED_HOSTS=localhost 127.0.0.1 [::1] vf bloons.walter.lol
DJANGO_CSRF_TRUSTED_ORIGINS=bloons.walter.lol
DJANGO_SECRET_KEY=password123
DJANGO_DEBUG=1
SQL_ENGINE=django.db.backends.postgresql

View File

@ -31,7 +31,7 @@ def load_insecure_key():
SECRET_KEY = os.environ.get("DJANGO_SECRET_KEY") or load_insecure_key()
ALLOWED_HOSTS = os.environ.get("DJANGO_ALLOWED_HOSTS", "*").split(" ")
CSRF_TRUSTED_ORIGINS = list(f"https://{x.replace('https://', '')}" for x in os.environ.get("DJANGO_ALLOWED_HOSTS", "*").split(" "))
CSRF_TRUSTED_ORIGINS = list(f"https://{x.replace('https://', '')}" for x in os.environ.get("DJANGO_CSRF_TRUSTED_ORIGINS", "*").split(" "))
SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")
print(f"{DEBUG=}")

View File

@ -14,6 +14,7 @@ services:
- DJANGO_SECRET_KEY
- DJANGO_ALLOWED_HOSTS
- DJANGO_DEBUG
- DJANGO_CSRF_TRUSTED_ORIGINS
- SQL_ENGINE
- SQL_DATABASE
- SQL_USER