Skip to main content

Allows permissions for an anonymous user and a generic signed-in user to be set as groups.

Project description

django-authanon

pipline

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-authanon-0.1.2.tar.gz (7.1 kB view hashes)

Uploaded Source

Built Distribution

django_authanon-0.1.2-py3-none-any.whl (7.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page