Registry / database / djongo

djongo

JSON →
library1.3.7pypypi✓ verified 85d ago

Djongo is a MongoDB connector for Django that allows you to use MongoDB as your backend database with the Django ORM. It works by translating Django ORM queries into MongoDB-compatible ones. Current version: 1.3.7. Release cadence: sporadic, last release in 2021.

pip install djongo
INSTALL
IMPORT
SIG · DJONGO
D
djongo
databasepythonv1.3.7
Install
5.1s avg
Import
Disk
69MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.3.7 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 70MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 5.1s · import 0.000s · 71MB
69MB installed
● package 69MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

djongo
import djongo
from djongo import ...
Typically you don't import djongo directly; you just add it to INSTALLED_APPS

Configure Django to use MongoDB via djongo as the database engine.

# settings.py INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'djongo', # add djongo ] DATABASES = { 'default': { 'ENGINE': 'djongo', 'NAME': 'your-db-name', 'ENFORCE_SCHEMA': True, 'CLIENT': { 'host': os.environ.get('MONGO_HOST', 'localhost'), 'port': int(os.environ.get('MONGO_PORT', 27017)), 'username': os.environ.get('MONGO_USER', ''), 'password': os.environ.get('MONGO_PASS', ''), } } }
Debug
Known issues
breakingDjongo is not compatible with Django 4.x or later. It relies on internal Django APIs that changed in Django 4. Use Django 3.2 or earlier.
fix
Downgrade Django to 3.2 LTS or consider alternative like mongoengine.
affects: djongo < 1.3.8
gotchaDjongo does not support all Django ORM queries. Complex joins, subqueries, and some aggregation may fail or produce incorrect results.
fix
Test queries thoroughly; fallback to raw MongoDB queries via PyMongo if needed.
affects: all
deprecatedThe djongo project is in maintenance mode and no longer actively developed. No updates since 2021.
fix
Consider migrating to a more active MongoDB-Django connector like beanie, mongoengine, or motor.
affects: all
Errors
Common errors & fixes
django.core.exceptions.ImproperlyConfigured: 'djongo' isn't an available database backend.
Djongo not installed or not added to INSTALLED_APPS in older versions.
fix
Run 'pip install djongo' and ensure 'djongo' is in INSTALLED_APPS.
ModuleNotFoundError: No module named 'djongo'
Djongo package not installed.
fix
Install with: pip install djongo
django.db.utils.OperationalError: no such table: ...
Djongo does not support migrations with SQL-style table creation. It works collection-based.
fix
Run 'python manage.py migrate' to create collections (but it may not create tables). Use 'python manage.py makemigrations' only if you have models.
Upgrade
Version history
1.3.7latest on PyPI · released Nov 12, 2024
Audit
Dependencies
DjangorequiredDjongo requires Django 2.x or 3.x, but not fully compatible with Django 4+
pymongorequiredRequired for MongoDB driver
sqlparserequiredUsed for SQL parsing
Agent activity
10 hits · last 30 days
node
8
Amazon
2
Resources
djongo — pip install djongo · libregistry