Skip to main content

Restricts access to specific urls to staff only by responding with a specific view or raising a 404

Project description

Django Restricted Paths

Description

Restricts access to specific urls to staff only by responding with a specific view or raising a 404.

Installation

pip install django-restricted-paths

Usage

in settings.py:

RESTRICTED_PATHS = {
  "ENABLED": not DEBUG,
  "PATHS": ("/admin",),
  "VIEW": "path.to.view.class.ViewClass",
}

MIDDLEWARE = (
    ...
    "restricted_paths.middleware.RestrictedPathsMiddleware"
)

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-restricted-paths-1.4.0.tar.gz (3.1 kB view hashes)

Uploaded Source

Built Distribution

django_restricted_paths-1.4.0-py3-none-any.whl (3.8 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