| 1 |
Metadata-Version: 2.1 |
| 2 |
Name: djoser |
| 3 |
Version: 2.3.3 |
| 4 |
Summary: REST implementation of Django authentication system. |
| 5 |
Home-page: https://github.com/sunscrapers/djoser |
| 6 |
License: MIT |
| 7 |
Author: Sunscrapers |
| 8 |
Author-email: [email protected] |
| 9 |
Maintainer: Tomasz Wojcik |
| 10 |
Maintainer-email: [email protected] |
| 11 |
Requires-Python: >=3.9,<4.0 |
| 12 |
Classifier: Development Status :: 5 - Production/Stable |
| 13 |
Classifier: Framework :: Django |
| 14 |
Classifier: Framework :: Django :: 3.2 |
| 15 |
Classifier: Framework :: Django :: 4.0 |
| 16 |
Classifier: Framework :: Django :: 4.1 |
| 17 |
Classifier: Framework :: Django :: 4.2 |
| 18 |
Classifier: Framework :: Django :: 5.0 |
| 19 |
Classifier: Framework :: Django :: 5.1 |
| 20 |
Classifier: Framework :: Django :: 5.2 |
| 21 |
Classifier: Intended Audience :: Developers |
| 22 |
Classifier: License :: OSI Approved :: MIT License |
| 23 |
Classifier: Operating System :: OS Independent |
| 24 |
Classifier: Programming Language :: Python |
| 25 |
Classifier: Programming Language :: Python :: 3 |
| 26 |
Classifier: Programming Language :: Python :: 3.9 |
| 27 |
Classifier: Programming Language :: Python :: 3.10 |
| 28 |
Classifier: Programming Language :: Python :: 3.11 |
| 29 |
Classifier: Programming Language :: Python :: 3.12 |
| 30 |
Classifier: Programming Language :: Python :: 3.13 |
| 31 |
Provides-Extra: djet |
| 32 |
Provides-Extra: webauthn |
| 33 |
Requires-Dist: django (>=3.2) |
| 34 |
Requires-Dist: djangorestframework (>=3.14) |
| 35 |
Requires-Dist: djangorestframework-simplejwt (>=5.0,<6.0) |
| 36 |
Requires-Dist: djet (>=0.3.0,<0.4.0) ; extra == "djet" |
| 37 |
Requires-Dist: social-auth-app-django (>=5.0.0,<6.0.0) |
| 38 |
Requires-Dist: webauthn (<1.0) ; extra == "webauthn" |
| 39 |
Project-URL: Documentation, https://djoser.readthedocs.io/ |
| 40 |
Project-URL: Repository, https://github.com/sunscrapers/djoser |
| 41 |
Description-Content-Type: text/x-rst |
| 42 |
|
| 43 |
====== |
| 44 |
djoser |
| 45 |
====== |
| 46 |
|
| 47 |
.. image:: https://img.shields.io/pypi/v/djoser.svg |
| 48 |
:target: https://pypi.org/project/djoser |
| 49 |
|
| 50 |
.. image:: https://github.com/sunscrapers/djoser/actions/workflows/test-suite.yml/badge.svg?branch=master |
| 51 |
:target: https://github.com/sunscrapers/djoser/actions?query=branch%3Amaster |
| 52 |
:alt: Build Status |
| 53 |
|
| 54 |
.. image:: https://codecov.io/gh/sunscrapers/djoser/branch/master/graph/badge.svg |
| 55 |
:target: https://codecov.io/gh/sunscrapers/djoser |
| 56 |
|
| 57 |
.. image:: https://img.shields.io/pypi/dm/djoser |
| 58 |
:target: https://img.shields.io/pypi/dm/djoser |
| 59 |
|
| 60 |
.. image:: https://readthedocs.org/projects/djoser/badge/?version=latest |
| 61 |
:target: https://djoser.readthedocs.io/en/latest/ |
| 62 |
:alt: Docs |
| 63 |
|
| 64 |
REST implementation of `Django <https://www.djangoproject.com/>`_ authentication |
| 65 |
system. **djoser** library provides a set of `Django Rest Framework <https://www.django-rest-framework.org/>`_ |
| 66 |
views to handle basic actions such as registration, login, logout, password |
| 67 |
reset and account activation. It works with |
| 68 |
`custom user model <https://docs.djangoproject.com/en/dev/topics/auth/customizing/>`_. |
| 69 |
|
| 70 |
Supported features include: |
| 71 |
|
| 72 |
- Token-based authentication |
| 73 |
- JWT authentication |
| 74 |
- Social authentication |
| 75 |
- WebAuthn support |
| 76 |
|
| 77 |
Instead of reusing Django code (e.g. ``PasswordResetForm``), we reimplemented |
| 78 |
few things to fit better into `Single Page App <https://en.wikipedia.org/wiki/Single-page_application>`_ |
| 79 |
architecture. |
| 80 |
|
| 81 |
Developed by `SUNSCRAPERS <http://sunscrapers.com/>`_ with passion & patience. |
| 82 |
|
| 83 |
.. image:: https://asciinema.org/a/94J4eG2tSBD2iEfF30a6vGtXw.png |
| 84 |
:target: https://asciinema.org/a/94J4eG2tSBD2iEfF30a6vGtXw |
| 85 |
|
| 86 |
Requirements |
| 87 |
============ |
| 88 |
|
| 89 |
To be able to run **djoser** you have to meet the following requirements: |
| 90 |
|
| 91 |
- Python>=3.9,<4.0 (including 3.10, 3.11, and 3.12) |
| 92 |
- Django>=3.0.0 (supporting Django 3.2 through 5.1) |
| 93 |
- Django REST Framework>=3.12 |
| 94 |
|
| 95 |
Installation |
| 96 |
============ |
| 97 |
|
| 98 |
Simply install using ``pip``: |
| 99 |
|
| 100 |
.. code-block:: bash |
| 101 |
|
| 102 |
$ pip install djoser |
| 103 |
|
| 104 |
And continue with the steps described at |
| 105 |
`configuration <https://djoser.readthedocs.io/en/latest/getting_started.html#configuration>`_ |
| 106 |
guide. |
| 107 |
|
| 108 |
Documentation |
| 109 |
============= |
| 110 |
|
| 111 |
Documentation is available to study at |
| 112 |
`https://djoser.readthedocs.io <https://djoser.readthedocs.io>`_ |
| 113 |
and in ``docs`` directory. |
| 114 |
|
| 115 |
Contributing and development |
| 116 |
============================ |
| 117 |
|
| 118 |
To start developing on **djoser**, clone the repository: |
| 119 |
|
| 120 |
.. code-block:: bash |
| 121 |
|
| 122 |
$ git clone [email protected]:sunscrapers/djoser.git |
| 123 |
|
| 124 |
We use `poetry <https://python-poetry.org/>`_ as dependency management and packaging tool. |
| 125 |
|
| 126 |
.. code-block:: bash |
| 127 |
|
| 128 |
$ cd djoser |
| 129 |
$ poetry install --all-extras |
| 130 |
|
| 131 |
This will create a virtualenv with all development dependencies. |
| 132 |
|
| 133 |
To run the test just type: |
| 134 |
|
| 135 |
.. code-block:: bash |
| 136 |
|
| 137 |
$ poetry run pytest |
| 138 |
|
| 139 |
We also prepared a convenient ``Makefile`` to automate commands above: |
| 140 |
|
| 141 |
.. code-block:: bash |
| 142 |
|
| 143 |
$ make init |
| 144 |
$ make test |
| 145 |
|
| 146 |
To activate the virtual environment run |
| 147 |
|
| 148 |
.. code-block:: bash |
| 149 |
|
| 150 |
$ poetry shell |
| 151 |
|
| 152 |
Without poetry |
| 153 |
-------------- |
| 154 |
|
| 155 |
New versions of ``pip`` can use ``pyproject.toml`` to build the package and install its dependencies. |
| 156 |
|
| 157 |
.. code-block:: bash |
| 158 |
|
| 159 |
$ pip install .[test] |
| 160 |
|
| 161 |
.. code-block:: bash |
| 162 |
|
| 163 |
$ cd testproject |
| 164 |
$ ./manage.py test |
| 165 |
|
| 166 |
Example project |
| 167 |
--------------- |
| 168 |
|
| 169 |
You can also play with test project by running following commands: |
| 170 |
|
| 171 |
.. code-block:: bash |
| 172 |
|
| 173 |
$ make migrate |
| 174 |
$ make runserver |
| 175 |
|
| 176 |
Commiting your code |
| 177 |
------------------- |
| 178 |
|
| 179 |
Before sending patches please make sure you have `pre-commit <https://pre-commit.com/>`_ activated in your local git repository: |
| 180 |
|
| 181 |
.. code-block:: bash |
| 182 |
|
| 183 |
$ poetry run pre-commit install |
| 184 |
|
| 185 |
This will ensure that your code is cleaned before you commit it. The pre-commit hooks will run: |
| 186 |
|
| 187 |
- Black (code formatting) |
| 188 |
- Ruff (linting) |
| 189 |
- Docformatter (docstring formatting) |
| 190 |
- Other quality checks |
| 191 |
|
| 192 |
Similar projects |
| 193 |
================ |
| 194 |
|
| 195 |
List of projects related to Django, REST and authentication: |
| 196 |
|
| 197 |
- `django-rest-registration <https://github.com/apragacz/django-rest-registration>`_ |
| 198 |
- `django-oauth-toolkit <https://github.com/evonove/django-oauth-toolkit>`_ |
| 199 |
|
| 200 |
Please, keep in mind that while using custom authentication and TokenCreateSerializer |
| 201 |
validation, there is a path that **ignores intentional return of None** from authenticate() |
| 202 |
and try to find User using parameters. Probably, that will be changed in the future. |
| 203 |
|