Skip to main content

Django MongoDB Backend

Django MongoDB Backend is a Django database backend that uses PyMongo to connect to MongoDB.

Documentation

Documentation written in the style of MongoDB's documentation is available at https://www.mongodb.com/docs/languages/python/django-mongodb/current/.

Documentation written in the style of Django's documentation is available at https://django-mongodb-backend.readthedocs.io/en/latest/.

Quick Start

Install

Use the version of django-mongodb-backend that corresponds to your version of Django. For example, to get the latest compatible release for Django 5.2.x:

pip install django-mongodb-backend==5.2.*

Create a project

From your shell, run the following command to create a new Django project called example using our project template. Make sure the end of the template URL corresponds to your version of Django (e.g. 5.2.x.zip for any Django 5.2.x version).

django-admin startproject example --template https://github.com/mongodb-labs/django-mongodb-project/archive/refs/heads/5.2.x.zip

You can check what version of Django you're using with:

django-admin --version

Connect to the database

Navigate to your example/settings.py file and replace the DATABASES setting using your connection string:

DATABASES = {
    "default": {
        "ENGINE": "django_mongodb_backend",
        "HOST": "<CONNECTION_STRING_URI>",
        "NAME": "db_name",
    },
}

[!TIP] You can quickly and easily deploy a free cluster with MongoDB Atlas.

Run the server

To verify that you correctly configured your project, run the following command from your project root:

python manage.py runserver

Then, visit http://127.0.0.1:8000/. This page displays a "Congratulations!" message and an image of a rocket.

Getting Help

You can ask usage questions on our support channels.

Reporting Bugs and Requesting Features

To report a bug or request a new feature in Django MongoDB Backend, please open an issue in JIRA:

  1. Create a JIRA account.
  2. Navigate to the Python Integrations project.
  3. Click Create Issue. Please provide as much information as possible about the issue and the steps to reproduce it.

Bug reports for the Django MongoDB Backend project can be viewed by everyone.

If you identify a security vulnerability in this project or in any other MongoDB project, please report it according to the instructions found at Create a Vulnerability Report.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_mongodb_backend-5.2.4.tar.gz (187.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_mongodb_backend-5.2.4-py3-none-any.whl (107.7 kB view details)

Uploaded Python 3

File details

Details for the file django_mongodb_backend-5.2.4.tar.gz.

File metadata

  • Download URL: django_mongodb_backend-5.2.4.tar.gz
  • Upload date:
  • Size: 187.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for django_mongodb_backend-5.2.4.tar.gz
Algorithm Hash digest
SHA256 0f8128879e000aea1afd336cc7540eb1960e44f7c01489c719d052ea45600e90
MD5 25ce547e0f3ff4ee380d637a4b04f1d8
BLAKE2b-256 427a057dd454774a62d3e5a6b5b9e82f9c1164028357bf28a4af12ec66293d2a

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_mongodb_backend-5.2.4.tar.gz:

Publisher: release-python.yml on mongodb/django-mongodb-backend

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file django_mongodb_backend-5.2.4-py3-none-any.whl.

File metadata

File hashes

Hashes for django_mongodb_backend-5.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 cad2b72e06d286fb6d5d2b32b343a8f0fecad24aa7733b265c805fb2ebaceaec
MD5 bcbada52512c4263df00112b53ae8cb7
BLAKE2b-256 ad7c79eb7855dfe738869c3fc5fad857fa502f2d065a94811075402e17abf349

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_mongodb_backend-5.2.4-py3-none-any.whl:

Publisher: release-python.yml on mongodb/django-mongodb-backend

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

6.1.0

2 files

6.0.4

2 files

6.0.3

2 files

6.0.2

2 files

6.0.1

2 files

6.0.0

2 files

This release

5.2.4 This release

2 files

5.2.3

2 files

5.2.2

2 files

5.2.1

2 files

5.2.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page