Skip to main content

A Django middleware that make all views and URLs login required.

Project description

Django Global Login Required Middleware (django-glrm) is a Django middleware that make all views and URLs login required.

It’s common in Django that most of the site’s pages are protected, with just a few exceptions of pages that remain public (e.g. login page, etc.). It can be quite tedious to decorate all of the views with @login_required, and it can be easy to forget to decorate some of them.

So, you can use Django Global Login Required Middleware to make all page login required excep some of them.

Documentation is avalible at Read The Docs.

Quick start

  1. Install Django Global Login Required Middleware:

    $ pip install django-glrm
  2. Add “global_login_required.GlobalLoginRequiredMiddleware” to your MIDDLEWARE setting like this:

    MIDDLEWARE = [
        ...
        'global_login_required.GlobalLoginRequiredMiddleware',
    ]

3. Start the development server and visit http://127.0.0.1:8000/, now all your pages are login required and you will see the login page.

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-glrm-1.1.3.tar.gz (13.4 kB view details)

Uploaded Source

File details

Details for the file django-glrm-1.1.3.tar.gz.

File metadata

  • Download URL: django-glrm-1.1.3.tar.gz
  • Upload date:
  • Size: 13.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for django-glrm-1.1.3.tar.gz
Algorithm Hash digest
SHA256 e35831a74d0248a8eb4d5f9d5821d556c28c68cd6de9afc0527ea073c58a8bc5
MD5 fa98de462002237c8a6bf9ae4bccf375
BLAKE2b-256 53013864e91c4a45d8393ca11061588fb755c351cc9510f3a4bd07ca304d4c77

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