Skip to content

Commit

Permalink
Update database settings configuration logic
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
hareshkainthdbt committed Dec 13, 2024
1 parent dac6e17 commit 86bd418
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions fbr/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 = [
{
Expand Down

0 comments on commit 86bd418

Please sign in to comment.