Skip to content

Commit 6b422ea

Browse files
aclark4lifeJibola
andauthored
Use django_mongodb.parse_uri (#3)
* Use django_mongodb.parse_uri * Update project_name/settings.py-tpl Co-authored-by: Jib <[email protected]> --------- Co-authored-by: Jib <[email protected]>
1 parent e64ecb0 commit 6b422ea

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

project_name/settings.py-tpl

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ For the full list of settings and their values, see
1010
https://docs.djangoproject.com/en/{{ docs_version }}/ref/settings/
1111
"""
1212

13+
import django_mongodb
14+
1315
from pathlib import Path
1416

1517
# Build paths inside the project like this: BASE_DIR / 'subdir'.
@@ -73,15 +75,8 @@ WSGI_APPLICATION = '{{ project_name }}.wsgi.application'
7375
# Database
7476
# https://docs.djangoproject.com/en/{{ docs_version }}/ref/settings/#databases
7577

76-
DATABASES = {
77-
"default": {
78-
"ENGINE": "django_mongodb",
79-
"NAME": "my_database",
80-
# "USER": "my_username",
81-
# "PASSWORD": "my_password",
82-
# "OPTIONS": {...},
83-
},
84-
}
78+
DATABASES = {}
79+
DATABASES["default"] = django_mongodb.parse_uri("mongodb://localhost:27017/{{ project_name }}")
8580

8681
# Password validation
8782
# https://docs.djangoproject.com/en/{{ docs_version }}/ref/settings/#auth-password-validators

0 commit comments

Comments
 (0)