django-rest-framework Authentication Using better Token-based authorization with several client-tokens


Example

The most interesting package for managing real tokens is django-rest-knox which supports multiple tokens per user (and cancelling each token independently), as well as having support for token expiration and several other security mechanisms.

django-rest-knox depends on cryptography. You can find more information on how to install it at: http://james1345.github.io/django-rest-knox/installation/

Installing knox

pip install django-rest-knox

settings.py

INSTALLED_APPS = (
  ...
  'rest_framework',
  'knox',
  ...
)

Apply migrations:

./manage.py migrate