A django app with token based authentication for both Session and API Token
Project description
User Authentication with Token and/or Cookie Support
This is an initial readme. Check out PYPI: https://pypi.org/project/user-authentication-jr/
Add this to your settings:
- add to
INSTALLED_APPS
after admin, auth and contenttypes
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
...,
'authentication',
]
- to use the User model
AUTH_USER_MODEL = 'authentication.User'
- add authentication class
DEFAULT_AUTHENTICATION_CLASSES = [...., 'authentication.utils.token.ExpiringTokenAuthentication']
REST_FRAMEWORK_TOKEN_SECONDS_EXPIRY = 3600
- add url entry for module to your urls.py
path('auth/', include('authentication.urls')),
- make sure admin app gets rollbacked to zero first
python manage.py migrate admin zero
- do migrations
python manage.py migrate
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
Built Distribution
Close
Hashes for user-authentication-jr-0.0.8.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a0c01e4d4e92907d28e6f251f3f52ce4566edc8a6bc5e166bcdb84f139f458a |
|
MD5 | 6a301887b55b04f351097e2e6915c4f2 |
|
BLAKE2b-256 | ffb7e106b2ec82cd9dc52b6ad5e6ac644624718ce2dd74b4f2c0ed74f4c29b98 |
Close
Hashes for user_authentication_jr-0.0.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2fab8f743e32dab3a7c7cfd4ffbbd5b8f777c16f86be8293599b4a359b437f91 |
|
MD5 | 493ccae04f95962642bd38a2e84ec39f |
|
BLAKE2b-256 | 693b9b181980e44ee061a0dbc29a531b04b28765cbb728cfa69e1fc6b29c0269 |