Differentiate production and testing ALLOWED_HOSTS

newer-dal
LEdoian 4 years ago
parent a17313a146
commit 10b16f6c39

@ -19,10 +19,14 @@ if isfile(SECRETS_FILE):
with open(SECRETS_FILE, "r") as f: with open(SECRETS_FILE, "r") as f:
DEBUG = False DEBUG = False
SECRET_KEY = f.readline().strip() SECRET_KEY = f.readline().strip()
ALLOWED_HOSTS = ['wish.ledoian.cz']
print("Running in production")
else: else:
DEBUG = True DEBUG = True
# Bad, old, already has been in Git... # Bad, old, already has been in Git...
SECRET_KEY = 'h-mqswfvdslj#c@p264l*@qpsmsj6$$c052dsrh7a^(uza4q2a' SECRET_KEY = 'h-mqswfvdslj#c@p264l*@qpsmsj6$$c052dsrh7a^(uza4q2a'
ALLOWED_HOSTS = []
print("TEST SERVER!")
# Build paths inside the project like this: BASE_DIR / 'subdir'. # Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent 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 # Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/ # See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/
ALLOWED_HOSTS = ['wish.ledoian.cz']
# Application definition # Application definition

Loading…
Cancel
Save