diff --git a/django/app/example/settings.py b/django/app/example/settings.py index 5f9061e..72046df 100644 --- a/django/app/example/settings.py +++ b/django/app/example/settings.py @@ -12,6 +12,14 @@ https://docs.djangoproject.com/en/1.11/ref/settings/ import os +from environs import Env +from dotenv import load_dotenv +from dotenv import find_dotenv + + +env = Env() +load_dotenv(find_dotenv()) + # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) @@ -20,12 +28,13 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = 'h8+mu_iy6%5j%7+hp**+gsq$nmy!!mjd8z_qkd94@z!%9%!+qn' +SECRET_KEY = env('SECRET_KEY', + 'h8+mu_iy6%5j%7+hp**+gsq$nmy!!mjd8z_qkd94@z!%9%!+qn') # SECURITY WARNING: don't run with debug turned on in production! -DEBUG = True +DEBUG = env.bool('DEBUG', True) -ALLOWED_HOSTS = [] +ALLOWED_HOSTS = env.list("ALLOWED_HOSTS", ("localhost", "127.0.0.1")) # Application definition diff --git a/django/app/requirements.txt b/django/app/requirements.txt index 2cf7578..705ee21 100644 --- a/django/app/requirements.txt +++ b/django/app/requirements.txt @@ -1 +1,2 @@ -Django==3.0.5 \ No newline at end of file +Django==3.0.5 +environs==7.3.1 \ No newline at end of file