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
Built Distribution
Close
Hashes for django-restricted-paths-1.3.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5233b5e8d767ce9aa33fdbd151708c90386eeaacf26acbe35baf72042404cc99 |
|
MD5 | 93f3a9f1c985499a2fb8a6bd5abdfa5c |
|
BLAKE2b-256 | da2e58abd4ce9994501c7e00144444072e47c60cb47bde3f52aedbc72eb67875 |
Close
Hashes for django_restricted_paths-1.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 524e961b5a0615b71a0f8f3361421a7f6751b294622ea4db41d5a53152eb4b73 |
|
MD5 | 1cfc70a1f619c3e1087689ec5ca3e288 |
|
BLAKE2b-256 | 18f9fbbadccf3e709872cfbe235f72ec739b44878dadbb3d852ab6ec5b4adafb |