so for day 2, i decided to revisit it—but this time, with a simple authentication flow. my goal was to test if the mongodb backend now plays nicely with third-party libraries like django-allauth.
setup & default user flow
mongodb has solid documentation, but i prefer following the official github readme:
This backend is currently in development and is not advised for production workflows. Backwards incompatible
changes may be made without notice. We welcome your feedback as we continue to
explore and build. The best way to share this is via our MongoDB Community Forum.
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 --pre django-mongodb-backend==5.2.*
(Until the package is out of beta, you must use pip's --pre option.)
Quickstart
Start project
From your shell, run the following command to create a new Django project
called example using our custom template. Make sure the zipfile referenced
at the end of the template link corresponds to your version…
the setup process involves bootstrapping a project from their provided templates:
# install the backend
pip install--pre django-mongodb-backend==5.2.*# start a new project from the mongodb template
django-admin startproject example --template https://github.com/mongodb-labs/django-mongodb-project/archive/refs/heads/5.2.x.zip
# start an app from their sample app template
python manage.py startapp sample_mflix --template https://github.com/mongodb-labs/django-mongodb-app/archive/refs/heads/5.1.x.zip
authentication works out of the box, even with custom user models.
the only issue i had was not running mongo locally—so performance took a hit. but honestly, seeing my django data as mongodb documents? that was deeply satisfying.
i'm using jazzmin for the admin interface. adds some nice polish.
trying django-allauth with mongodb
unfortunately, still no support.
from the docs:
"we plan to test compatibility with the following third-party libraries by the ga release: