Expiring token with expiration time update for Django Rest Framework
Project description
Django Expiring Token adds token expiration on token authentication and extends the expiration time on each authenticated request.
Django Expiring Token provides a very lightweight extension to DRF’s existing token authentication. It implements the following functionalities:
Tokens expire after the set time.
On each authenticated request, the expiration time is updated by the set time.
Quick start
Do NOT add “restframework.authtoken” to you INSTALLED_APPS.
Add “django_expiring_token” to your INSTALLED_APPS setting like this:
INSTALLED_APPS = [ ... 'django_expiring_token', ]
Include the polls URLconf in your project urls.py like this:
path('custom-url/', include('django_expiring_token.urls')),
Add the expiration time in settings.py:
EXPIRING_TOKEN_DURATION=timedelta(hours=1) # Any timedelta setting can be used!
Run python manage.py migrate to create the ExpiringToken model.
Start the development server.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for django-expiring-token-1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba057c099ab91a0f075100a5ca4cadb75973852a8d93cca0f79f20bc3b94704e |
|
MD5 | 0cac6344c445531ce594f6f25f8583f3 |
|
BLAKE2b-256 | fcef5382277e1736123f5b833b20d3900e70e6eb09a0613d7d3569aec9c4f120 |
Hashes for django_expiring_token-1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7b8cc268fe2cbf613de9e706da979dc6d4ff7d0e197e3be32d922731d4865822 |
|
MD5 | fe596d98709d2cea737b05d184f53f5e |
|
BLAKE2b-256 | 24b86bfb7bb0edba129dc98ddedd23e0694afafb220220ec53dfc2f886423669 |