Reusable Django app for Penn Labs accounts
Project description
Requirements
Python 3.4+
Django 2.0+
Installation
- Install with pipenv
pipenv install django-labs-accounts
Add accounts to INSTALLED_APPS
INSTALLED_APPS = (
...
'accounts.apps.AccountsConfig',
...
)
Add the new accounts backend to AUTHENTICATION_BACKENDS
AUTHENTICATION_BACKENDS = (
...
'django.contrib.auth.backends.ModelBackend',
...
)
Add the following to urls.py
urlpatterns = [
...
path('accounts/', include('accounts.urls', namespace='accounts')),
...
]
Documentation
All settings are handled with a PLATFORM_ACCOUNTS dictionary.
Example:
PLATFORM_ACCOUNTS = {
'CLIENT_ID': 'id',
'CLIENT_SECRET': 'secret',
'REDIRECT_URI': 'example',
'ADMIN_PERMISSION': 'example_admin'
}
The available settings are:
CLIENT_ID the client ID to connect to platform with. Defaults to LABS_CLIENT_ID environment variable.
CLIENT_SECRET the client secret to connect to platform with. Defaults to LABS_CLIENT_SECRET environment variable.
REDIRECT_URI the redirect uri to send to platform. Defaults to LABS_REDIRECT_URI environment variable.
SCOPE the scope for this applications tokens. Must include introspection. Defaults to ['read', 'introspection'].
PLATFORM_URL URL of platform server to connect to. Should be https://platform(-dev).pennlabs.org (no trailing slash)
ADMIN_PERMISSION The name of the permission on platform to grant admin access. Defaults to example_admin
Changelog
See CHANGELOG.md.
License
See LICENSE.md.
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
Hashes for django-labs-accounts-0.3.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f7bd1b41cce4cd59c004cf0da60f2d298b1dae927bb48ea8e55d6fc92b23c440 |
|
MD5 | e4c68f134cb867f73aa2fc23aece5fbf |
|
BLAKE2b-256 | 3748afe9ca2ef7491243440b1ff5c93c3d32073cc4c0b2f550cdc52c87b17eab |
Hashes for django_labs_accounts-0.3.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b59af24212821ff66be2ac71b23f1208ae6138599dacb0666a00ad7f4c29873c |
|
MD5 | 46fd54131ccf85f35e2d2a5949d51832 |
|
BLAKE2b-256 | c10b6d911a8ba81dc22ba1df292ec40c15aacfe1e46f76d5e5ec2b6b798dc03d |