Skip to main content

Django helper for Lona

Project description

This package contains Lona helper to integrate with Django.

Installation

$ pip install lona-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


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.1.tar.gz (4.3 kB view details)

Uploaded Source

File details

Details for the file lona-django-0.1.1.tar.gz.

File metadata

  • Download URL: lona-django-0.1.1.tar.gz
  • Upload date:
  • Size: 4.3 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

Hashes for lona-django-0.1.1.tar.gz
Algorithm Hash digest
SHA256 15fda474278d0e9ae9ae923ee83cb60fa2f1308417776a701385ad1fded43e50
MD5 49aca1af948cd455d5ed7aa55a493221
BLAKE2b-256 5440ce57aaf73925285d200318fe9de43e17c2c712aeb776b8b25e97ade3b326

See more details on using hashes here.

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