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
Built Distribution
Close
Hashes for django_simple_ip_restrict-1.0.32.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca29b7c633de4b5a860d84538e44539fb9eb24f6097c58243f450168aa1bc4ef |
|
MD5 | e71c47bf6d15d21d1ca79cc4671da41c |
|
BLAKE2b-256 | a1554c385a40fced7a6aa6b74d6b086e76680da8ae254bbef8de368ef199ae40 |
Close
Hashes for django_simple_ip_restrict-1.0.32-py3.8.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 73f0e3b9e25ffbe35fdb4bf0cf0d8ad616d4d0b56ed4ab4120b3cbc395309c62 |
|
MD5 | 9e6a6c7bf647349998923f06c57d37c3 |
|
BLAKE2b-256 | 00e19f7725b353cd6a99a503d93e987db2abdea1fab7df72a39a7f9cbf1db1de |