Allows permissions for an anonymous user and a generic signed-in user to be set as groups.
Project description
django-authanon
Allows permissions for an anonymous user and a generic signed-in user to be set as groups.
Installation
pip install django-authanon
Then add to your INSTALLED_APPS
:
INSTALLED_APPS += [
"authanon",
]
Then add to your AUTHENTICATION_BACKENDS
:
AUTHENTICATION_BACKENDS += [
"authanon.backends.AuthanonBackend",
]
Usage
This app creates two groups, one for anonymous users who aren't logged in and one group for users who are logged in. You can add permissions to these groups in the admin console in the 'Groups' section under the 'AUTHENTICATION AND AUTHORIZATION' section.
To display the permissions for these two groups on the command line, use this command.
./manage.py authanon
These groups are automatically created when anonymous users or logged-in users try to access pages. If you find they haven't been created yet, use the ./manage.py authanon
command and then the groups will appear in the admin.
Configuration
By default, the two groups are called Anonymous
and Login Users
. You can change them by variables to the settings with the names AUTHANON_ANONYMOUS_GROUP
or AUTHANON_LOGIN_GROUP
.
Credits
Package authored by Robert Turnbull (Melbourne Data Analytics Platform)
Inspired by this Stack Overflow answer: https://stackoverflow.com/a/31520798 (User: jozxyqk)
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
File details
Details for the file django-authanon-0.1.2.tar.gz
.
File metadata
- Download URL: django-authanon-0.1.2.tar.gz
- Upload date:
- Size: 7.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.11 CPython/3.9.7 Darwin/19.5.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e45653d6bd32178f9bbb3be0c4690a33616525960c064d9c330fb4bea53fa940 |
|
MD5 | 6c731ae0a10a9943aff013ebe1281e19 |
|
BLAKE2b-256 | 87b411d9703b5457eef8bc4d09bc4c3bd8e2489a142dc1458fd9046bcbff9e35 |
File details
Details for the file django_authanon-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: django_authanon-0.1.2-py3-none-any.whl
- Upload date:
- Size: 7.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.11 CPython/3.9.7 Darwin/19.5.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 67f9828b6ab22081cfd2842e61ee75956f9b7b27c07a0a9b900fd31b02839448 |
|
MD5 | 9b841580af8dc6faf4e60505c7c385e2 |
|
BLAKE2b-256 | 2ea5d6ead5f7bb3f80559a84714267d3e796656b0e3eb7c97b9237051b009f1e |