This commit is contained in:
Andros Fenollosa
2024-09-01 21:36:14 +02:00
parent 5f1f9de569
commit 488bdfe3e2
3 changed files with 24 additions and 8 deletions

View File

@ -10,7 +10,6 @@ For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
import os
import dj_database_url
from pathlib import Path
from django.db.backends.signals import connection_created
@ -75,9 +74,14 @@ TEMPLATES = [
# https://docs.djangoproject.com/en/3.2/ref/settings/#databases
DATABASES = {
"default": dj_database_url.config(
default=f"postgres://{os.environ.get('DB_USER')}:{os.environ.get('DB_PASSWORD')}@{os.environ.get('DB_HOST')}:{os.environ.get('DB_PORT')}/{os.environ.get('DB_NAME')}"
)
"default": {
"ENGINE": "django.db.backends.postgresql",
"NAME": os.environ.get("POSTGRES_NAME"),
"USER": os.environ.get("POSTGRES_USER"),
"PASSWORD": os.environ.get("POSTGRES_PASSWORD"),
"HOST": os.environ.get("POSTGRES_HOST"),
"PORT": os.environ.get("POSTGRES_PORT"),
}
}
# Password validation