This app makes it extremely easy to build Django powered SPA's (Single Page App) or Mobile apps exposing all registration and authentication related functionality as CBV's (Class Base View) and REST (JSON)
Go to file
alichass 0722ec4aee added the ability to customise claims in the jwt token - has tests
JWT claim serializer now can be set to something custom in settings:
JWT_TOKEN_CLAIMS_SERIALIZER = myTokenObtainSerializer

Ideally JWT_TOKEN_CLAIMS_SERIALIZER  would be a key in REST_AUTH_SERIALIZERS and assigned through import_callable, as with the other serializers; however, I could not quite figure out how to implement it that way
2020-06-20 13:20:07 -05:00
.circleci Adds run step names 2020-06-20 13:02:48 -05:00
demo aligned requirements to tox.ini 2020-06-15 19:28:23 +02:00
dj_rest_auth added the ability to customise claims in the jwt token - has tests 2020-06-20 13:20:07 -05:00
docs add secure and samesite jwt cookie support 2020-06-15 17:12:41 +02:00
rest_auth/locale/sv/LC_MESSAGES Merge pull request #79 from lideen/master 2020-05-30 12:43:21 -05:00
.coveralls.yml Adds coverage repo token 2020-03-06 18:04:47 -06:00
.gitignore Merge pull request #94 from chrsz/feature/jwt_secure_samesite 2020-06-20 13:14:12 -05:00
AUTHORS Uses new org 2020-03-01 16:42:28 -06:00
CONTRIBUTING.md Adds contributing file 2020-03-06 17:48:57 -06:00
dev-requirements.txt Simplfies CI config + Pins dep versions 2020-06-20 12:53:16 -05:00
LICENSE Adds circle CI 2020-02-29 18:58:59 -06:00
MANIFEST.in Renames project to dj-rest-auth 2020-02-29 17:59:38 -06:00
README.md Fixes the Circle CI Link 2020-05-16 15:58:57 -05:00
runtests.py Fixes references to serializers + isort 2020-02-29 23:56:21 -06:00
setup.cfg Add wheel & metdata config 2018-08-21 21:29:15 -07:00
setup.py Adds xml outputs 2020-06-20 12:25:55 -05:00
tox.ini Adds a tox.ini file and instructions in the readme for how to use it. 2020-05-16 13:41:45 -07:00

Dj-Rest-Auth

Jazzband Coverage Status

Drop-in API endpoints for handling authentication securely in Django Rest Framework. Works especially well with SPAs (e.g React, Vue, Angular), and Mobile applications.

Requirements

  • Django 2 or 3.
  • Python 3

Quick Setup

Install package

pip install dj-rest-auth

Add dj_rest_auth app to INSTALLED_APPS in your django settings.py:

INSTALLED_APPS = (
    ...,
    'rest_framework',
    'rest_framework.authtoken',
    ...,
    'dj_rest_auth'
)

Add URL patterns

urlpatterns = [
    url(r'^dj-rest-auth/', include('dj_rest_auth.urls'))
]

(Optional) Use Http-Only cookies

REST_USE_JWT = True
JWT_AUTH_COOKIE = 'jwt-auth'

Testing

To run the tests within a virtualenv, run python runtests.py from the repository directory. The easiest way to run test coverage is with coverage, which runs the tests against all supported Django installs. To run the test coverage within a virtualenv, run coverage run ./runtests.py from the repository directory then run coverage report.

Tox

Testing may also be done using tox, which will run the tests against all supported combinations of python and django.

Install tox, either globally or within a virtualenv, and then simply run tox from the repository directory. As there are many combinations, you may run them in parallel using tox --parallel.

The tox.ini includes an environment for testing code coverage and you can run it and view this report with tox -e coverage.

Linting may also be performed via flake8 by running tox -e flake8.

Documentation

View the full documentation here: https://dj-rest-auth.readthedocs.io/en/latest/index.html

Acknowledgements

This project began as a fork of django-rest-auth. Big thanks to everyone who contributed to that repo!