From 0fa9cda51fe31b3d2205e1b0feece26d59f56c34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Valenta?= <git@imaniti.org> Date: Mon, 24 Jul 2023 10:31:21 +0900 Subject: [PATCH] add env allowed hosts --- env.example | 4 ++++ institut/settings/base.py | 4 ++++ institut/settings/production.py | 1 - 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/env.example b/env.example index 2c2f3f5..dbae37c 100644 --- a/env.example +++ b/env.example @@ -1 +1,5 @@ DATABASE_URL="postgresql://institut:institut@localhost:5432/postgres" + +# ALLOWED_HOSTS=dev.imaniti.org +# SECRET_KEY=asdf +# CSRF_TRUSTED_ORIGINS=https://dev.imaniti.org diff --git a/institut/settings/base.py b/institut/settings/base.py index fb98f3b..9141d27 100644 --- a/institut/settings/base.py +++ b/institut/settings/base.py @@ -28,6 +28,10 @@ environ.Env.read_env(os.path.join(BASE_DIR, ".env")) # See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/ +ALLOWED_HOSTS = env.list("ALLOWED_HOSTS", []) +CSRF_TRUSTED_ORIGINS = env.list("CSRF_TRUSTED_ORIGINS", []) + + # Application definition INSTALLED_APPS = [ diff --git a/institut/settings/production.py b/institut/settings/production.py index 891c575..42e0957 100644 --- a/institut/settings/production.py +++ b/institut/settings/production.py @@ -2,7 +2,6 @@ from .base import * DEBUG = False SECRET_KEY = env.str("SECRET_KEY") -ALLOWED_HOSTS = env.list("ALLOWED_HOSTS") try: from .local import * -- GitLab