Compare commits

..

No commits in common. "045b56d8f8bb09b0be4bc2c43cdb517036847c6b" and "f8542a6d7ac0cdf379ad0cdfba87179236b3cf06" have entirely different histories.

2 changed files with 18 additions and 15 deletions

View File

@ -2,7 +2,6 @@ import os
from pathlib import Path from pathlib import Path
from datetime import timedelta from datetime import timedelta
from dotenv import load_dotenv from dotenv import load_dotenv
import dj_database_url
load_dotenv() load_dotenv()
@ -12,8 +11,10 @@ SECRET_KEY = os.getenv('JWT_SECRET', 'django-insecure-fallback-secret-key')
DEBUG = os.getenv('DEBUG') DEBUG = os.getenv('DEBUG')
# Update ALLOWED_HOSTS for production
ALLOWED_HOSTS = os.getenv('ALLOWED_HOSTS', '*').split(',') ALLOWED_HOSTS = os.getenv('ALLOWED_HOSTS', '*').split(',')
# Update CORS for production
CORS_ALLOWED_ORIGINS = os.getenv( CORS_ALLOWED_ORIGINS = os.getenv(
'CORS_ALLOWED_ORIGINS', 'CORS_ALLOWED_ORIGINS',
'http://localhost:3000,http://127.0.0.1:3000' 'http://localhost:3000,http://127.0.0.1:3000'
@ -76,21 +77,23 @@ if not DEBUG:
SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https") SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")
if os.getenv('DATABASE_URL'): # DATABASES = {
DATABASES = { # 'default': {
'default': dj_database_url.config( # 'ENGINE': 'django.db.backends.sqlite3',
default=os.getenv('DATABASE_URL'), # 'NAME': BASE_DIR / 'db.sqlite3',
conn_max_age=600, # }
conn_health_checks=True, # }
)
} DATABASES = {
else:
DATABASES = {
'default': { 'default': {
'ENGINE': 'django.db.backends.sqlite3', 'ENGINE': 'django.db.backends.postgresql',
'NAME': BASE_DIR / 'db.sqlite3', 'NAME': os.getenv('POSTGRES_DB'),
} 'USER': os.getenv('POSTGRES_USER'),
'PASSWORD': os.getenv('POSTGRES_PASSWORD'),
'HOST': os.getenv('POSTGRES_HOST', 'postgres'),
'PORT': os.getenv('POSTGRES_PORT', 5432),
} }
}
ENCRYPTION_KEY = os.getenv('ENCRYPTION_KEY') ENCRYPTION_KEY = os.getenv('ENCRYPTION_KEY')

Binary file not shown.