From 9387f44b0f6dc477aec66e9b3ae64cb2c79ac3ed Mon Sep 17 00:00:00 2001 From: cxrxixs Date: Sat, 11 May 2024 19:59:08 +0800 Subject: [PATCH] Django settings add DB_USER --- .github/workflows/main.yml | 1 + core/settings.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c1f1093..22b9cf4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,6 +16,7 @@ jobs: - 5432:5432 env: POSTGRES_DB: db_test + POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres POSTGRES_PORT: 5432 # set health checks to wait until postgres has started diff --git a/core/settings.py b/core/settings.py index 33d665b..d7433c4 100644 --- a/core/settings.py +++ b/core/settings.py @@ -41,7 +41,7 @@ REDIS_PORT = env("REDIS_PORT") else: DB_NAME = os.environ.get("DB_NAME") or os.environ.get("POSTGRES_DB") - DB_USER = os.environ.get("DB_USER") + DB_USER = os.environ.get("DB_USER") or os.environ.get("POSTGRES_USER") DB_PASSWORD = os.environ.get("DB_PASSWORD") or os.environ.get( "POSTGRES_PASSWORD" )