Install django-environ

This commit is contained in:
Fred Pauchet 2021-10-27 20:37:19 +02:00
parent deb217d2c7
commit f4c3b7a1b4
2 changed files with 12 additions and 7 deletions

View File

@ -13,6 +13,8 @@ https://docs.djangoproject.com/en/3.2/ref/settings/
import os
from pathlib import Path
import environ
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
@ -21,12 +23,13 @@ BASE_DIR = Path(__file__).resolve().parent.parent
# See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'django-insecure-$7aqo!kqk!91=*b@+l4$noatl8k&(*(3n&s-58hb59l(wuk6l3'
SECRET_KEY = env('SECRET_KEY')
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
DEBUG = env('DEBUG')
ALLOWED_HOSTS = []
ALLOWED_HOSTS = os.getenv('ALLOWED_HOSTS').split()
# Application definition
@ -76,10 +79,11 @@ WSGI_APPLICATION = 'gwift.wsgi.application'
# https://docs.djangoproject.com/en/3.2/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
}
# read os.environ['DATABASE_URL'] and raises
# ImproperlyConfigured exception if not found
#
# The db() method is an alias for db_url().
'default': env.db(),
}

View File

@ -1,4 +1,5 @@
django==3.2.8
django-environ==0.8.1
gunicorn
boto3