🚀(settings) standardize DATABASE_URL environment retrieval

(settings) standardize DATABASE_URL environment retrieval
This commit is contained in:
Bastien Ogier
2026-02-09 23:36:55 +01:00
committed by aleb_the_flash
parent bfadeae6ee
commit 2c65cc061e

View File

@@ -13,7 +13,7 @@ https://docs.djangoproject.com/en/3.1/ref/settings/
# pylint: disable=too-many-lines
import json
from os import environ, path
from os import path
from socket import gethostbyname, gethostname
from django.utils.translation import gettext_lazy as _
@@ -94,7 +94,9 @@ class Base(Configuration):
# Database
DATABASES = {
"default": dj_database_url.config()
if environ.get("DATABASE_URL")
if values.DatabaseURLValue(
None, environ_name="DATABASE_URL", environ_prefix=None
)
else {
"ENGINE": values.Value(
"django.db.backends.postgresql_psycopg2",