From 6dc43c2f21d2f426f8f72c0528b8c13fbe026803 Mon Sep 17 00:00:00 2001 From: Nico Virkki Date: Thu, 9 Nov 2023 19:37:14 +0200 Subject: [PATCH] Use database password if present in env Refs KER-273 --- kerrokantasi/settings/base.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kerrokantasi/settings/base.py b/kerrokantasi/settings/base.py index 064b0cb4..d59792fc 100644 --- a/kerrokantasi/settings/base.py +++ b/kerrokantasi/settings/base.py @@ -45,6 +45,7 @@ def get_git_revision_hash(): ALLOWED_HOSTS=(list, []), ADMINS=(list, []), DATABASE_URL=(str, "postgis:///kerrokantasi"), + DATABASE_PASSWORD=(str, ""), TEST_DATABASE_URL=(str, ""), MEDIA_ROOT=(environ.Path(), root("media")), STATIC_ROOT=(environ.Path(), root("static")), @@ -111,6 +112,9 @@ def get_git_revision_hash(): if env.db("TEST_DATABASE_URL"): DATABASES["default"]["TEST"] = env.db("TEST_DATABASE_URL") +if env("DATABASE_PASSWORD"): + DATABASES["default"]["PASSWORD"] = env("DATABASE_PASSWORD") + MEDIA_ROOT = env("MEDIA_ROOT") MEDIA_URL = env("MEDIA_URL")