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.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 176396d76104ebe6bb4af37083d65dee6909dba0ac25452993ab8284ba963e56 |
|
MD5 | 3210bf6155ab33954a6b9ec8a676bf29 |
|
BLAKE2b-256 | d2dbea37bbef5261c3b965d01637e1c1e1009b0d30bf8e7dfff4410f3e221597 |
Close
Hashes for django_restricted_paths-1.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 202f1937ee3b8effc39fc4e7d57bd362e0f9e4fcb343f0bfb256e83c04dfb491 |
|
MD5 | b94d52462868832d77bc33d257c4b7af |
|
BLAKE2b-256 | 0f952da660f02422d9dccd6d174f4d9242e9b5e0e379b9140e259e2e7d6fe5fe |