From e74553c5ac1510bf0eb0d97868ebcf6b978e0eff Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Tue, 9 Sep 2025 11:23:44 -0400 Subject: [PATCH] INTPYTHON-743 Configure DATABASES with connection string in HOST --- project_name/settings.py-tpl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/project_name/settings.py-tpl b/project_name/settings.py-tpl index f63fd7b..ea1719c 100644 --- a/project_name/settings.py-tpl +++ b/project_name/settings.py-tpl @@ -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'. @@ -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/', + 'NAME': '{{ project_name }}', + }, } # Database routers