Generate API tokens for django-restframework
Project description
django-apitokens
Generate tokens compatible with Django Restframework (drf
) from your Django Admin view:
- Create new tokens at will (after being generated, they no longer can be reversed, since only a digest is stored in the database).
- Add expirity dates (supports time and date)
- Remove tokens when you no longer need them.
My Token view
Add token view
Install
- Install the python package:
pip install django-apitokens
- Add
apitokens
to your Django installed apps:
# In your settings.py
INSTALLED_APPS = [
...
'apitokens',
]
- Ensure you are using
knox
TokenAuthentication
class:
# In your settings.py
REST_FRAMEWORK = {
...,
'DEFAULT_AUTHENTICATION_CLASSES': (
'knox.auth.TokenAuthentication',
...,
),
...,
}
- You are set to use tokens generated through this app as a way to login with the DRF framework.
Contributing
To contribute code to this app, ensure you're following the community guidelines
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
django-apitokens-0.0.2.tar.gz
(10.5 kB
view details)
Built Distribution
File details
Details for the file django-apitokens-0.0.2.tar.gz
.
File metadata
- Download URL: django-apitokens-0.0.2.tar.gz
- Upload date:
- Size: 10.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 33c7e4a78f37bded037264352dc273575dc4d446a4a30a12fd9f546276a08581 |
|
MD5 | c1a2f9d03c4e52b19ad2a7f15b359247 |
|
BLAKE2b-256 | 5a8781d280847f1d29e57fb186f6838d9d98dc978fbb914da7842ba530b971a3 |
Provenance
File details
Details for the file django_apitokens-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: django_apitokens-0.0.2-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d464108f600731b3fa8de4fbf103993b0b7e330170410ee978f9b7698ec73c9d |
|
MD5 | 5f44b9211cae3722cab186663fa8373b |
|
BLAKE2b-256 | a4021be312d0f54eec08b894595d70d59a44d14157d127de0e23c42bb048226d |