Skip to content

Commit

Permalink
fetch MongoDB URI and use within settings.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Jibola committed Jan 17, 2025
1 parent 072a2e8 commit 4b0ee2d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/mongodb_settings.py
Original file line number Diff line number Diff line change
@@ -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",
},
Expand Down

0 comments on commit 4b0ee2d

Please sign in to comment.