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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb9c22d1a533084045432bcc6db1352112841f33689c24eab897980b23472e08 |
|
MD5 | 1871b598bbfe3bbdaeb025f4dde585d4 |
|
BLAKE2b-256 | 88e9d35b5beba5f1d0c1acdef901814077c7cf17c94244f1fbde24b0a2f169ca |
Close
Hashes for django_simple_ip_restrict-1.0.1-py3.7.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 362aca90f72d51a473fd72b1589b44bf098e6a6f118a273ca449c250d65535b3 |
|
MD5 | 316338f5a551891e6e0117de0e9506be |
|
BLAKE2b-256 | 8b8985e5105d25286e07119d8838714390ec597e393f3eaa9bccc5e85a89aed7 |