From 0d35685d4f00c7648dae34638db955f8cb200f45 Mon Sep 17 00:00:00 2001 From: cxrxixs Date: Sat, 11 May 2024 19:54:35 +0800 Subject: [PATCH] Django settings DB_PORT fallback 5432 --- .github/workflows/main.yml | 4 ++-- core/settings.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4e569dd..c1f1093 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,11 +13,11 @@ jobs: postgres: image: postgres ports: - - 5439:5439 + - 5432:5432 env: POSTGRES_DB: db_test POSTGRES_PASSWORD: postgres - POSTGRES_PORT: 5439 + POSTGRES_PORT: 5432 # set health checks to wait until postgres has started options: >- --health-cmd pg_isready diff --git a/core/settings.py b/core/settings.py index 8b8bcc6..33d665b 100644 --- a/core/settings.py +++ b/core/settings.py @@ -46,7 +46,7 @@ "POSTGRES_PASSWORD" ) DB_HOST = os.environ.get("DB_HOST") or "localhost" - DB_PORT = os.environ.get("DB_PORT") or os.environ.get("POSTGRES_PORT") + DB_PORT = os.environ.get("DB_PORT") or "5432" REDIS_HOST = os.environ.get("REDIS_HOST") REDIS_PORT = os.environ.get("REDIS_PORT")