|
|
|
|
@ -10,22 +10,29 @@ For the full list of settings and their values, see
|
|
|
|
|
https://docs.djangoproject.com/en/3.1/ref/settings/
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
import os
|
|
|
|
|
import dj_database_url
|
|
|
|
|
|
|
|
|
|
from pathlib import Path
|
|
|
|
|
|
|
|
|
|
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
|
|
|
|
BASE_DIR = Path(__file__).resolve().parent.parent
|
|
|
|
|
# .env config
|
|
|
|
|
from dotenv import load_dotenv, find_dotenv
|
|
|
|
|
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__)))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Quick-start development settings - unsuitable for production
|
|
|
|
|
# See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/
|
|
|
|
|
|
|
|
|
|
# SECURITY WARNING: keep the secret key used in production secret!
|
|
|
|
|
SECRET_KEY = 'n6&$_khrc&w%r&ufg$qmat915-4uhnoux)-_nttj&-0sxpn#dh'
|
|
|
|
|
SECRET_KEY = os.environ['SECRET_KEY']
|
|
|
|
|
|
|
|
|
|
# SECURITY WARNING: don't run with debug turned on in production!
|
|
|
|
|
DEBUG = True
|
|
|
|
|
|
|
|
|
|
ALLOWED_HOSTS = []
|
|
|
|
|
ALLOWED_HOSTS = ['localhost']
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Application definition
|
|
|
|
|
@ -85,6 +92,9 @@ DATABASES = {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Updating database when deployed
|
|
|
|
|
db_from_env = dj_database_url.config(conn_max_age=600)
|
|
|
|
|
DATABASES['default'].update(db_from_env)
|
|
|
|
|
|
|
|
|
|
# Password validation
|
|
|
|
|
# https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators
|
|
|
|
|
@ -123,3 +133,4 @@ USE_TZ = True
|
|
|
|
|
# https://docs.djangoproject.com/en/3.1/howto/static-files/
|
|
|
|
|
|
|
|
|
|
STATIC_URL = '/static/'
|
|
|
|
|
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
|