From c330ad8276d1227276b800fc810452cbeafa004f Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sat, 3 Apr 2021 15:35:55 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Get=20settings=20from=20os.envir?= =?UTF-8?q?on?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sophon/settings.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sophon/settings.py b/sophon/settings.py index 33c4191..41c3167 100644 --- a/sophon/settings.py +++ b/sophon/settings.py @@ -11,6 +11,7 @@ https://docs.djangoproject.com/en/3.1/ref/settings/ """ from pathlib import Path +import os # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = Path(__file__).resolve().parent.parent @@ -20,10 +21,10 @@ BASE_DIR = Path(__file__).resolve().parent.parent # See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = '%oe8eyp^)-t*7p*_o@v09i7san+_en!pa@b_985o+xx)hvs4(%' +SECRET_KEY = os.environ["DJANGO_SECRET_KEY"] # SECURITY WARNING: don't run with debug turned on in production! -DEBUG = True +DEBUG = bool(os.environ.get("DJANGO_DEBUG")) ALLOWED_HOSTS = [] @@ -103,9 +104,9 @@ AUTH_PASSWORD_VALIDATORS = [ # Internationalization # https://docs.djangoproject.com/en/3.1/topics/i18n/ -LANGUAGE_CODE = 'en-us' +LANGUAGE_CODE = os.environ.get("DJANGO_LANGUAGE_CODE", "en-us") -TIME_ZONE = 'UTC' +TIME_ZONE = os.environ.get("DJANGO_TIME_ZONE", "UTC") USE_I18N = True