Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

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.

Files for django-restricted-paths, version 1.4.0
Filename, size File type Python version Upload date Hashes
Filename, size django_restricted_paths-1.4.0-py3-none-any.whl (3.8 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size django-restricted-paths-1.4.0.tar.gz (3.1 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page