Skip to content

Commit 4b0ee2d

Browse files
committed
fetch MongoDB URI and use within settings.py
1 parent 072a2e8 commit 4b0ee2d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

.github/workflows/mongodb_settings.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
1+
import os
2+
3+
from django_mongodb_backend import parse_uri
4+
5+
PARSED_URI = parse_uri(os.getenv("MONGODB_URI")) if os.getenv("MONGODB_URI") else {}
6+
7+
18
DATABASES = {
29
"default": {
10+
**PARSED_URI,
311
"ENGINE": "django_mongodb_backend",
412
"NAME": "djangotests",
513
},
614
"other": {
15+
**PARSED_URI,
716
"ENGINE": "django_mongodb_backend",
817
"NAME": "djangotests-other",
918
},

0 commit comments

Comments
 (0)