{"id":23618,"library":"djongo","title":"Djongo - Django MongoDB Connector","description":"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.","status":"maintenance","version":"1.3.7","language":"python","source_language":"en","source_url":"https://github.com/doableware/djongo","tags":["django","mongodb","orm","database","nosql"],"install":[{"cmd":"pip install djongo","lang":"bash","label":"Default install"}],"dependencies":[{"reason":"Djongo requires Django 2.x or 3.x, but not fully compatible with Django 4+","package":"Django","optional":false},{"reason":"Required for MongoDB driver","package":"pymongo","optional":false},{"reason":"Used for SQL parsing","package":"sqlparse","optional":false}],"imports":[{"note":"Typically you don't import djongo directly; you just add it to INSTALLED_APPS","wrong":"from djongo import ...","symbol":"djongo","correct":"import djongo"}],"quickstart":{"code":"# settings.py\nINSTALLED_APPS = [\n    'django.contrib.admin',\n    'django.contrib.auth',\n    'django.contrib.contenttypes',\n    'django.contrib.sessions',\n    'django.contrib.messages',\n    'django.contrib.staticfiles',\n    'djongo', # add djongo\n]\n\nDATABASES = {\n    'default': {\n        'ENGINE': 'djongo',\n        'NAME': 'your-db-name',\n        'ENFORCE_SCHEMA': True,\n        'CLIENT': {\n            'host': os.environ.get('MONGO_HOST', 'localhost'),\n            'port': int(os.environ.get('MONGO_PORT', 27017)),\n            'username': os.environ.get('MONGO_USER', ''),\n            'password': os.environ.get('MONGO_PASS', ''),\n        }\n    }\n}\n","lang":"python","description":"Configure Django to use MongoDB via djongo as the database engine."},"warnings":[{"fix":"Downgrade Django to 3.2 LTS or consider alternative like mongoengine.","message":"Djongo 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.","severity":"breaking","affected_versions":"djongo < 1.3.8"},{"fix":"Test queries thoroughly; fallback to raw MongoDB queries via PyMongo if needed.","message":"Djongo does not support all Django ORM queries. Complex joins, subqueries, and some aggregation may fail or produce incorrect results.","severity":"gotcha","affected_versions":"all"},{"fix":"Consider migrating to a more active MongoDB-Django connector like beanie, mongoengine, or motor.","message":"The djongo project is in maintenance mode and no longer actively developed. No updates since 2021.","severity":"deprecated","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'pip install djongo' and ensure 'djongo' is in INSTALLED_APPS.","cause":"Djongo not installed or not added to INSTALLED_APPS in older versions.","error":"django.core.exceptions.ImproperlyConfigured: 'djongo' isn't an available database backend."},{"fix":"Install with: pip install djongo","cause":"Djongo package not installed.","error":"ModuleNotFoundError: No module named 'djongo'"},{"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.","cause":"Djongo does not support migrations with SQL-style table creation. It works collection-based.","error":"django.db.utils.OperationalError: no such table: ..."}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}