From 10b16f6c39119dbab3c17de0f279b761def61b9f Mon Sep 17 00:00:00 2001 From: Pavel 'LEdoian' Turinsky Date: Fri, 26 Feb 2021 12:22:25 +0100 Subject: [PATCH] Differentiate production and testing ALLOWED_HOSTS --- wish/settings.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wish/settings.py b/wish/settings.py index dc0c271..8e9827a 100644 --- a/wish/settings.py +++ b/wish/settings.py @@ -19,10 +19,14 @@ if isfile(SECRETS_FILE): with open(SECRETS_FILE, "r") as f: DEBUG = False SECRET_KEY = f.readline().strip() + ALLOWED_HOSTS = ['wish.ledoian.cz'] + print("Running in production") else: DEBUG = True # Bad, old, already has been in Git... SECRET_KEY = 'h-mqswfvdslj#c@p264l*@qpsmsj6$$c052dsrh7a^(uza4q2a' + ALLOWED_HOSTS = [] + print("TEST SERVER!") # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = Path(__file__).resolve().parent.parent @@ -31,7 +35,6 @@ BASE_DIR = Path(__file__).resolve().parent.parent # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/ -ALLOWED_HOSTS = ['wish.ledoian.cz'] # Application definition