Skip to content

Commit

Permalink
Merge pull request #10 from mobidata-bw/rename-host-env-var
Browse files Browse the repository at this point in the history
rename host env var
  • Loading branch information
the-infinity authored Oct 18, 2023
2 parents d74b12a + 5431f31 commit 25eabe8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions webapp/common/config/config_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ def configure_app(app: Flask, testing: bool = False) -> None:
# load all OCPDB-prefixed values from prefixed ENV
app.config.from_prefixed_env('PARK_API')

# load db credentials from env
# load postgresql credentials from env
if (
os.getenv('PARK_API_POSTGRES_USER')
and os.getenv('PARK_API_POSTGRES_DB')
and os.getenv('PARK_API_POSTGRES_PASSWORD')
and os.getenv('PARK_API_POSTGRES_DOCKER_COMPOSE_SERVICE')
and os.getenv('PARK_API_POSTGRES_HOST')
):
app.config['SQLALCHEMY_DATABASE_URI'] = (
f'postgresql://{os.getenv("PARK_API_POSTGRES_USER")}:{os.getenv("PARK_API_POSTGRES_PASSWORD")}'
f'@{os.getenv("PARK_API_POSTGRES_DOCKER_COMPOSE_SERVICE")}/{os.getenv("PARK_API_POSTGRES_DB")}'
f'@{os.getenv("PARK_API_POSTGRES_HOST")}/{os.getenv("PARK_API_POSTGRES_DB")}'
)

# Load config from yaml file
Expand Down

0 comments on commit 25eabe8

Please sign in to comment.