Apply an IP restriction to specific routes
Project description
django-simple-ip-restrict
This middleware allows you to mark Django URL namespaces as unavailable to all requests except those coming from a whitelisted IP subnet.
Instructions
Add to the list of MIDDLEWARE:
"django_simple_ip_restrict.middleware.ip_filter",
Then you can set the following keys on settings.py:
- IP_PROTECTED_NAMESPACES: list of namespaces to block (default: ["admin"])
- IP_NETWORKS_WHITELIST: list of subnets to allow, in CIDR notation
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for django_simple_ip_restrict-1.0.40.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e1c31eca1d05d9197242e6a684c1864514c115d4d0d64eb7c1191b4563d6e05a |
|
MD5 | 10c0df6dac0cf38b3500375dc8f68e75 |
|
BLAKE2b-256 | ee0db95a50a25fc9e367690fbef8059c01f7c4d7066deb812b68a6efe27eea18 |