Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions project_name/settings.py-tpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ For the full list of settings and their values, see
https://docs.djangoproject.com/en/{{ docs_version }}/ref/settings/
"""

import django_mongodb_backend

from pathlib import Path

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

DATABASES = {
"default": django_mongodb_backend.parse_uri("mongodb://localhost:27017/{{ project_name }}"),
'default': {
'ENGINE': 'django_mongodb_backend',
'HOST': 'mongodb://localhost:27017/',
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this configuration, "HOST" isn't needed. 'mongodb://localhost:27017/' basically only serves as quasi-documentation to show that you can put a connection string here, but may give some wrong impressions, like the fact that a port is required, so maybe we should rethink this.

'NAME': '{{ project_name }}',
},
}

# Database routers
Expand Down