Compare commits
No commits in common. "85217e4e9c9b116c1e588bfdb7cd7af29119aedc" and "f3ecaedb5567cd4d377db7475176cb63ee5fafc4" have entirely different histories.
85217e4e9c
...
f3ecaedb55
@ -11,26 +11,10 @@ https://docs.djangoproject.com/en/4.0/ref/settings/
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
import os
|
|
||||||
|
|
||||||
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
||||||
BASE_DIR = Path(__file__).resolve().parent.parent
|
BASE_DIR = Path(__file__).resolve().parent.parent
|
||||||
|
|
||||||
## ENVARS ##
|
|
||||||
|
|
||||||
POSTGRES_DB = os.getenv('POSTGRES_DB')
|
|
||||||
POSTGRES_USER = os.getenv('POSTGRES_USER')
|
|
||||||
POSTGRES_PASSWORD = os.getenv('POSTGRES_PASSWORD')
|
|
||||||
POSTGRES_HOST = os.getenv('POSTGRES_HOST')
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# SECURITY WARNING: don't run with debug turned on in production!
|
|
||||||
DEBUG = False
|
|
||||||
if os.getenv('DEBUG') == 'True':
|
|
||||||
DEBUG = True
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Quick-start development settings - unsuitable for production
|
# Quick-start development settings - unsuitable for production
|
||||||
# See https://docs.djangoproject.com/en/4.0/howto/deployment/checklist/
|
# See https://docs.djangoproject.com/en/4.0/howto/deployment/checklist/
|
||||||
@ -94,18 +78,6 @@ WSGI_APPLICATION = 'website.wsgi.application'
|
|||||||
# Database
|
# Database
|
||||||
# https://docs.djangoproject.com/en/4.0/ref/settings/#databases
|
# https://docs.djangoproject.com/en/4.0/ref/settings/#databases
|
||||||
|
|
||||||
DATABASES = {
|
|
||||||
'default': {
|
|
||||||
'ENGINE': 'django.db.backends.postgresql_psycopg2',
|
|
||||||
'NAME': POSTGRES_DB,
|
|
||||||
'USER': POSTGRES_USER,
|
|
||||||
'PASSWORD': POSTGRES_PASSWORD,
|
|
||||||
'HOST': POSTGRES_HOST,
|
|
||||||
'PORT': '5432',
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if os.getenv('DEV') == 'true':
|
|
||||||
DATABASES = {
|
DATABASES = {
|
||||||
'default': {
|
'default': {
|
||||||
'ENGINE': 'django.db.backends.sqlite3',
|
'ENGINE': 'django.db.backends.sqlite3',
|
||||||
@ -163,26 +135,3 @@ REST_FRAMEWORK = {
|
|||||||
'rest_framework.authentication.SessionAuthentication',
|
'rest_framework.authentication.SessionAuthentication',
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
# LOGGING = {
|
|
||||||
# 'version': 1,
|
|
||||||
# 'disable_existing_loggers': False,
|
|
||||||
# 'handlers': {
|
|
||||||
# 'file': {
|
|
||||||
# 'level': 'DEBUG',
|
|
||||||
# 'class': 'logging.FileHandler',
|
|
||||||
# 'filename': './debug.log',
|
|
||||||
# },
|
|
||||||
# 'error_file': {
|
|
||||||
# 'level': 'ERROR',
|
|
||||||
# 'class': 'logging.FileHandler',
|
|
||||||
# 'filename': './error.log',
|
|
||||||
# },
|
|
||||||
# },
|
|
||||||
# 'loggers': {
|
|
||||||
# 'django': {
|
|
||||||
# 'handlers': ['file', 'error_file'],
|
|
||||||
# 'propagate': True,
|
|
||||||
# },
|
|
||||||
# },
|
|
||||||
# }
|
|
||||||
|
Reference in New Issue
Block a user