Add "drf_secure_token" to your INSTALLED_APPS setting like this:
INSTALLED_APPS = [ ... 'rest_framework', 'drf_secure_token', ]
Add following lines to your settings.py:
REST_FRAMEWORK = { 'DEFAULT_AUTHENTICATION_CLASSES': [ 'rest_framework.authentication.BasicAuthentication', 'drf_secure_token.authentication.SecureTokenAuthentication', ] }
For updating token add this middleware to your MIDDLEWARE_CLASSES:
MIDDLEWARE_CLASSES = ( ... 'drf_secure_token.middleware.UpdateTokenMiddleware', )
Add UPDATE_TOKEN to your 'dev' settings if you don't want to update token in DEBUG mode:
UPDATE_TOKEN = False
Add TOKEN_AGE to your settings:
TOKEN_AGE = 60*10 # 10 min
- Run python manage.py migrate to create the drf_secure_token models.
forked from razortheory/drf-secure-token
th13f/drf-secure-token
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Packages 0
No packages published
Languages
- Python 100.0%