From 4b0ee2d92354a0a215b462c877ec9137f08ab755 Mon Sep 17 00:00:00 2001 From: Jib Date: Fri, 17 Jan 2025 10:06:53 -0500 Subject: [PATCH] fetch MongoDB URI and use within settings.py --- .github/workflows/mongodb_settings.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/mongodb_settings.py b/.github/workflows/mongodb_settings.py index dc543a1e..ea7079ea 100644 --- a/.github/workflows/mongodb_settings.py +++ b/.github/workflows/mongodb_settings.py @@ -1,9 +1,18 @@ +import os + +from django_mongodb_backend import parse_uri + +PARSED_URI = parse_uri(os.getenv("MONGODB_URI")) if os.getenv("MONGODB_URI") else {} + + DATABASES = { "default": { + **PARSED_URI, "ENGINE": "django_mongodb_backend", "NAME": "djangotests", }, "other": { + **PARSED_URI, "ENGINE": "django_mongodb_backend", "NAME": "djangotests-other", },