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:
- make sure admin app gets rollbacked to zero first
python manage.py migrate admin zero
- 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')),
- 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.9.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 096606e6c64c740e818ed1ff158d0300746d4aaf0643dfc3807ad46d3fd7e75b |
|
MD5 | 7aac30f2055c461a7d1c156694ee25fc |
|
BLAKE2b-256 | c80806d9c7dfde334c2c6288a5da481920132baebbbe9b63300361c44f626a59 |
Close
Hashes for user_authentication_jr-0.0.9-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7316d3856ccfd6659c839fea1f1d98a89fe67ac02dfb31ae788103b4783f6ed9 |
|
MD5 | 153044be5b2821cb29917a29189588c5 |
|
BLAKE2b-256 | a437c2a095befabc2d261c96c29be18b81aee4dda191897db1ea0badc66d240a |