Skip to content

Commit

Permalink
Merge pull request #456 from City-of-Helsinki/KER-273/dbpsswdstngs
Browse files Browse the repository at this point in the history
KER-273 | Read database password from env
  • Loading branch information
nicobav authored Nov 17, 2023
2 parents 4264c7a + 6dc43c2 commit d0c4c79
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions kerrokantasi/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")),
Expand Down Expand Up @@ -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")

Expand Down

0 comments on commit d0c4c79

Please sign in to comment.