djongo
Djongo: The Django MongoDB connector
What it is and what it does
Djongo is a Django database backend that bridges Django's ORM to MongoDB by translating SQL queries into MongoDB query documents. It lets you use MongoDB as your primary database for a Django project without rewriting your models or changing your Django code—you configure it in settings.py and run migrations as normal. The package acts as a SQL-to-MongoDB transpiler, so Django's standard features like the admin interface, authentication, and sessions are meant to work out of the box.
The package depends on sqlparse for query parsing, pymongo for MongoDB communication, django itself, and pytz for timezone handling. It is maintained actively and has a low installation footprint as a pure-Python wheel. However, it carries an Alpha classification, indicating that the API and behavior may still evolve; users should expect this to be a work-in-progress integration rather than a production-hardened solution.
Use it for:
- Migrate an existing Django project to MongoDB without rewriting models or ORM calls.
- Use MongoDB's document model while keeping Django's admin interface and authentication system.
- Prototype a Django application with MongoDB as the backing store to evaluate the document database approach.
- Run Django migrations and manage schema changes through MongoDB collections using standard Django tooling.
- Leverage Django contrib modules like sessions and auth with MongoDB as the persistence layer.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Djongo translates Django ORM queries into MongoDB queries, allowing you to use MongoDB as a Django database backend without modifying your models.
Yes, if you need to use MongoDB with Django and are comfortable with Alpha-stage software. The low install friction, active maintenance, and permissive license make it accessible. However, verify that your specific Django version and query patterns are supported, and test thoroughly in a non-production environment first—the Alpha status means edge cases and compatibility gaps may exist.
Install
djongo on PyPI
pip
pip install djongouv
uv add djongopoetry
poetry add djongoInstalling djongo
Before you install
Low install friction with a pure-Python wheel. Active maintenance with a recent commit on 2026-07-18 and 1922 repository stars. Classified as Alpha, so expect ongoing development and potential API changes.
License in practice
Licensed under AGPL with permissive treatment, meaning you can use it freely but derivative works must also be open-source under compatible terms.
Quickstart
pip install djongo
# In Django settings.py:
DATABASES = {
'default': {
'ENGINE': 'djongo',
'NAME': 'your-db-name',
}
}
# Then run:
python manage.py makemigrations
python manage.py migrate
Requires Python 3.6 or above; MongoDB must be running and accessible at the configured connection details.
Verify before relying
- Whether all Django contrib modules (admin, auth, sessions) work reliably in practice with complex queries.
- Performance characteristics compared to native Django database backends for typical workloads.
- Compatibility with the latest Django versions beyond what the classifiers indicate.
Package facts
| License | AGPL (permissive) |
| Python support | supports the current Python release (>=3.6) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — sqlparse, pymongo, django, pytz |
| Maintenance | actively maintained — 640 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 82,114/month — #14,183 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: djongo-1.3.7-py3-none-any.whl
Keywords: Django, Djongo, MongoDB, driver, connector
Tags
More Front-Ends packages
SQLAlchemy is a Python SQL toolkit and Object…
permissive · top 100 on PyPI
psycopg2-binarypsycopg2-binary is a PostgreSQL database…
copyleft · top 1,000 on PyPI
alembicAlembic generates and manages database schema…
permissive · top 1,000 on PyPI
weaviate-clientA Python client library for connecting to and…
permissive · top 1,000 on PyPI
databricks-sql-connectorA Python client library that connects to…
permissive · top 1,000 on PyPI
psycopgPsycopg 3 is a PostgreSQL database adapter for…
copyleft · top 1,000 on PyPI
mongo-query-matchProvides a MongoDB-like query language for…
unclear · top 15,000 on PyPI
Flask-PyMongoFlask-PyMongo integrates MongoDB database…
permissive · top 15,000 on PyPI
odata-queryParses OData v4 filter strings and transpiles…
permissive · top 15,000 on PyPI
sqlalchemy-bigquerySQLAlchemy dialect that enables you to use…
permissive · top 1,000 on PyPI
django-snowflakeProvides a Django database backend that…
permissive · top 15,000 on PyPI
django-query-builderBuilds and executes complex SQL queries…
permissive · top 15,000 on PyPI
mongoengineMongoEngine provides an Object-Document Mapper…
permissive · top 5,000 on PyPI
django-clickhouseIntegrates Django applications with ClickHouse,…
permissive · top 15,000 on PyPI
curatorbinPackages the MongoDB Curator tool as a Python…
unclear · top 5,000 on PyPI
django-tasks-dbA Django Tasks backend that stores and executes…
permissive · top 15,000 on PyPI