djoser
REST implementation of Django authentication system. djoser library provides a set of Django Rest Framework views to handle basic actions such as registration, login, logout, password reset and account activation. It works with custom user model.
Supported features include:
Token-based authentication
JWT authentication
Social authentication
WebAuthn support
Instead of reusing Django code (e.g. PasswordResetForm), we reimplemented few things to fit better into Single Page App architecture.
Developed by SUNSCRAPERS with passion & patience.
Requirements
To be able to run djoser you have to meet the following requirements:
Python>=3.9,<4.0 (including 3.10, 3.11, 3.12, and 3.13)
Django>=3.2 (supporting Django 3.2 through 5.2)
Django REST Framework>=3.14
Installation
Simply install using pip:
$ pip install djoser
And continue with the steps described at configuration guide.
Documentation
Documentation is available to study at https://djoser.readthedocs.io and in docs directory.
Contributing and development
To start developing on djoser, clone the repository:
$ git clone git@github.com:sunscrapers/djoser.git
We use uv as dependency management and packaging tool.
$ cd djoser
$ uv sync --all-extras --all-groups
This will create a virtualenv with all development dependencies.
To run the test just type:
$ uv run pytest testproject/
We also prepared a convenient Makefile to automate commands above:
$ make init
$ make test
To activate the virtual environment run
$ source .venv/bin/activate
Without uv
You can also use pip with pyproject.toml to build the package and install its dependencies.
$ pip install .[test]
$ cd testproject
$ ./manage.py test
Example project
You can also play with test project by running following commands:
$ make migrate
$ make runserver
Commiting your code
Before sending patches please make sure you have pre-commit activated in your local git repository:
$ uv run pre-commit install
This will ensure that your code is cleaned before you commit it. The pre-commit hooks will run:
Black (code formatting)
Ruff (linting)
Docformatter (docstring formatting)
Other quality checks
Similar projects
List of projects related to Django, REST and authentication:
Please, keep in mind that while using custom authentication and TokenCreateSerializer validation, there is a path that ignores intentional return of None from authenticate() and try to find User using parameters. Probably, that will be changed in the future.
Metadata
Release files for djoser 2.3.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| djoser-2.3.5.tar.gz | 33.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| djoser-2.3.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 106.9 kB
Release files / djoser-2.3.5.tar.gz
| Download URL | djoser-2.3.5.tar.gz |
|---|---|
| Size | 33.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
861487c21da73563da5c81ea61c3790f433d3e6ea80f4b2c2e9783ea9016c298
|
|
BLAKE2b-256 checksum How to use checksums |
0e0c776b9501f04f34fbf87018c4f9b13e0076c54e47be1804a057ae217edb57
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / djoser-2.3.5-py3-none-any.whl
| Download URL | djoser-2.3.5-py3-none-any.whl |
|---|---|
| Size | 73.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4c662040702840f10ed74f5938d13025e177331994c52f7b9fb03cfd32cdaa57
|
|
BLAKE2b-256 checksum How to use checksums |
9cb70d8ab682dea33a92caf83f55eb689028c0ba15cbc448b65446a5f213aeed
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|