REST implementation of Django authentication system.
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.
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.
To be able to run djoser you have to meet following requirements:
- Python (3.6, 3.7, 3.8, 3.9)
- Django (2.2, 3.1)
- Django REST Framework 3.11.1
If you need to support other versions, please use djoser<2.
Simply install using pip:
$ pip install djoser
And continue with the steps described at configuration guide.
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 firstname.lastname@example.org:sunscrapers/djoser.git
We use poetry as dependency management and packaging tool.
$ cd djoser $ poetry install -E test
This will create a virtualenv with all development dependencies.
To run the test just type:
$ poetry run py.test testproject
We also preapred a convenient Makefile to automate commands above:
$ make init $ make test
To activate the virtual environment run
$ poetry shell
New versions of pip can use pyproject.toml to build the package and install its dependencies.
$ pip install .[test]
$ cd testproject $ ./manage.py test
If you need to run tests against all supported Python and Django versions then invoke:
$ poetry run tox -p all
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:
$ pre-commit install
This will ensure that your code is cleaned before you commit it. Some steps (like black) automatically fix issues but the show their status as FAILED. Just inspect if eveything is OK, git-add the files and retry the commit. Other tools (like flake8) require you to manually fix the issues.
List of projects related to Django, REST and authentication:
- django-rest-auth (not maintained)
- django-rest-framework-digestauth (not maintained)
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.
Release history Release notifications | RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size djoser-2.1.0-py3-none-any.whl (46.2 kB)||File type Wheel||Python version py3||Upload date||Hashes View|
|Filename, size djoser-2.1.0.tar.gz (26.4 kB)||File type Source||Python version None||Upload date||Hashes View|