From 9419325a050b3ce83f691adb1a97e2336a0b53a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Palma?= Date: Mon, 26 Aug 2024 00:16:12 +0100 Subject: [PATCH] fix: allowed hosts, debug mode and secret key --- django/.env.dev | 2 +- django/tts_be/settings.py | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/django/.env.dev b/django/.env.dev index 753ff70..50aaa05 100644 --- a/django/.env.dev +++ b/django/.env.dev @@ -1,4 +1,4 @@ -DEBUG=0 +DEBUG=1 SECRET_KEY=foo POSTGRES_DB=tts diff --git a/django/tts_be/settings.py b/django/tts_be/settings.py index a276924..2966293 100644 --- a/django/tts_be/settings.py +++ b/django/tts_be/settings.py @@ -22,13 +22,11 @@ # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/4.0/howto/deployment/checklist/ -# SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = 'django-insecure-!d4s#a%mo7ou&nc+-b&qfx$nu&&vo_^z*kauh0-8@%)ni@ze+7' +SECRET_KEY = os.getenv('SECRET_KEY') -# SECURITY WARNING: don't run with debug turned on in production! -DEBUG = True -ALLOWED_HOSTS = ['0.0.0.0', 'localhost'] +DEBUG = False if int(os.getenv('DEBUG')) == 0 else True +ALLOWED_HOSTS = ['0.0.0.0', 'localhost', 'tts.niaefeup.pt', 'tts-staging.niaefeup.pt'] # Application definition