Dedent DATABASES dict

This commit is contained in:
Bruno Alla 2024-11-27 22:32:31 +01:00
parent bc525aec43
commit 958c39011e
No known key found for this signature in database

View File

@ -53,14 +53,14 @@ if db_url := env.db("DATABASE_URL", default=None):
DATABASES = {"default": db_url} DATABASES = {"default": db_url}
else: else:
DATABASES = { DATABASES = {
"default": { "default": {
"ENGINE": "django.db.backends.postgresql", "ENGINE": "django.db.backends.postgresql",
"NAME": env.str("POSTGRES_DB"), "NAME": env.str("POSTGRES_DB"),
"USER": env.str("POSTGRES_USER"), "USER": env.str("POSTGRES_USER"),
"PASSWORD": env.str("POSTGRES_PASSWORD"), "PASSWORD": env.str("POSTGRES_PASSWORD"),
"HOST": env.str("POSTGRES_HOST", default="{% if cookiecutter.windows == 'y' and cookiecutter.use_docker == 'n' %}localhost{%else%}postgres{% endif %}"), "HOST": env.str("POSTGRES_HOST", default="{% if cookiecutter.windows == 'y' and cookiecutter.use_docker == 'n' %}localhost{%else%}postgres{% endif %}"),
"PORT": env.str("POSTGRES_PORT", default="5432"), "PORT": env.str("POSTGRES_PORT", default="5432"),
}, },
} }
DATABASES["default"]["ATOMIC_REQUESTS"] = True DATABASES["default"]["ATOMIC_REQUESTS"] = True