Skip to content

Commit

Permalink
Use django_mongodb.parse_uri (#3)
Browse files Browse the repository at this point in the history
* Use django_mongodb.parse_uri

* Update project_name/settings.py-tpl

Co-authored-by: Jib <[email protected]>

---------

Co-authored-by: Jib <[email protected]>
  • Loading branch information
aclark4life and Jibola authored Dec 12, 2024
1 parent e64ecb0 commit 6b422ea
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions project_name/settings.py-tpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ For the full list of settings and their values, see
https://docs.djangoproject.com/en/{{ docs_version }}/ref/settings/
"""

import django_mongodb

from pathlib import Path

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

DATABASES = {
"default": {
"ENGINE": "django_mongodb",
"NAME": "my_database",
# "USER": "my_username",
# "PASSWORD": "my_password",
# "OPTIONS": {...},
},
}
DATABASES = {}
DATABASES["default"] = django_mongodb.parse_uri("mongodb://localhost:27017/{{ project_name }}")

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

0 comments on commit 6b422ea

Please sign in to comment.