Djoser provides a set of Django Rest Framework views to handle basic actions such as registration, login, logout, password reset, and account activation. It handles user authentication for Django REST Framework APIs, supporting various authentication backends including Token and JWT. The current version is 2.3.3, and it maintains an active release cadence with regular updates to support new Django and Python versions.
pip install djoserVerified import paths — ran on the pinned version, not inferred.
To integrate Djoser, first add `rest_framework` and `djoser` to your `INSTALLED_APPS`. Configure `AUTH_USER_MODEL` to point to your desired user model. Define `REST_FRAMEWORK` and `DJOSER` settings in your `settings.py` for authentication classes, permissions, and Djoser-specific URLs and serializers. For JWT, install `djangorestframework-simplejwt` and include `djoser.urls.jwt`. Finally, include Djoser's URLs in your project's `urls.py`.
Ensure your `settings.py` includes the correct `AUTHENTICATION_BACKENDS` configuration, e.g., `AUTHENTICATION_BACKENDS = ['django.contrib.auth.backends.ModelBackend']` for default Django users.
Upgrade your Django project to Django 3.2+ and your Python environment to Python 3.8+.
Update any custom code or `DJOSER` settings that use `ID_FIELD` to `USER_ID_FIELD`.
If experiencing Django version conflicts, ensure you are using Djoser 2.3.3 or later. Downgrade to 2.3.1 if issues persist and upgrading is not an immediate option.
If your project's email logic depends on `django-templated-mail`, explicitly add `pip install django-templated-mail` to your project's requirements.