this package adds some extra features to djangorestframework's Token Authentication like refresh token, lifetime for refresh token and authorization token.
- django
- djagnorestframework
pip install git+https://github.com/neel-bp/rest_framework-refreshtoken-auth.git
add refreshing_token
to INSTALLED_APPS
in settings.py
INSTALLED_APPS = [
...
'rest_framework',
'refreshing_token'
...
]
add refreshing_token.expiring_token.ExpiringTokenAuthentication
to the
list of authentication classes
REST_FRAMEWORK = {
...
'DEFAULT_AUTHENTICATION_CLASSES': (
...
'refreshing_token.expiring_token.ExpiringTokenAuthentication',
)
...
}
finally run python manage.py migrate
in your django project