Django helper for Lona
Project description
This package contains Lona helper to integrate with Django.
Django Auth
Django authentication, authorization and sessions are implemented in a Lona middleware.
# settings.py
MIDDLEWARES = [
'lona_django.middlewares.DjangoSessionMiddleware',
]
To configure authorization use the view flags listed below. The flags are all optional and can be mixed.
The Django user associated with the given request is available in request.user.
# views.py
from lona import LonaView
class DjangoView(LonaView):
DJANGO_AUTH_LOGIN_REQUIRED = False
DJANGO_AUTH_STAFF_REQUIRED = False
DJANGO_AUTH_STAFF_PERMISSION_OVERRIDE = True
DJANGO_AUTH_PERMISSIONS_REQUIRED = []
DJANGO_AUTH_GROUPS_REQUIRED = []
def handle_request(self, request):
user = request.user
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
lona-django-0.1.tar.gz
(3.1 kB
view details)
File details
Details for the file lona-django-0.1.tar.gz
.
File metadata
- Download URL: lona-django-0.1.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9b5823a628e4235a2d35fd67986a5497df1a9e2dab75b2aab8c3caa7fce509f |
|
MD5 | c549a4035942cf2de27c3b80aa2a9f4b |
|
BLAKE2b-256 | 056ce4b2483325b35d170b10b1766397191a21176c2185e4d66d04c28bfa7b3c |