https://github.com/surface-security/django-apitokens
Manage and Create DRF-compatible tokens from the UI
https://github.com/surface-security/django-apitokens
django django-rest-framework python token-based-authentication
Last synced: about 1 month ago
JSON representation
Manage and Create DRF-compatible tokens from the UI
- Host: GitHub
- URL: https://github.com/surface-security/django-apitokens
- Owner: surface-security
- License: mit
- Created: 2023-03-20T18:11:33.000Z (over 3 years ago)
- Default Branch: develop
- Last Pushed: 2023-07-27T10:44:35.000Z (almost 3 years ago)
- Last Synced: 2025-01-27T06:34:37.303Z (over 1 year ago)
- Topics: django, django-rest-framework, python, token-based-authentication
- Language: Python
- Homepage: https://pypi.org/project/django-apitokens/
- Size: 27.3 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# 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:
```python
# In your settings.py
INSTALLED_APPS = [
...
'apitokens',
]
```
- Ensure you are using `knox` `TokenAuthentication` class:
```python
# 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](https://github.com/surface-security/guidelines#contributing)