From 86bd4183878f0284d811e8a8ab8e7818688a676e Mon Sep 17 00:00:00 2001 From: Haresh Kainth Date: Fri, 13 Dec 2024 16:48:18 +0000 Subject: [PATCH] Update database settings configuration logic Replaced usage of `dj_database_url` with direct dictionary assignments for database settings. This simplifies the configuration and ensures explicit property definitions for the database engine and name. --- fbr/settings.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/fbr/settings.py b/fbr/settings.py index 7d2ad57..1ef3010 100644 --- a/fbr/settings.py +++ b/fbr/settings.py @@ -17,7 +17,6 @@ from pathlib import Path from typing import Any -import dj_database_url import environ from dbt_copilot_python.database import database_url_from_env @@ -130,15 +129,15 @@ # } if DATABASE_URL := env("DATABASE_CREDENTIALS", default=None): - DATABASES["default"] = dj_database_url.config( # noqa - default=database_url_from_env("DATABASE_CREDENTIALS"), - engine="postgresql", - ) + DATABASES["default"] = { + "NAME": database_url_from_env("DATABASE_CREDENTIALS"), + "ENGINE": "django.db.backends.postgresql", + } else: - DATABASES["default"] = dj_database_url.parse( - "{}", - engine="postgresql", - ) + DATABASES["default"] = { + "NAME": "{}", + "ENGINE": "django.db.backends.postgresql", + } AUTH_PASSWORD_VALIDATORS = [ {