This middleware allows you to mark Django URL namespaces as unavailable to all requests except those coming from a whitelisted IP subnet.
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
Creating a new release
Update the version in pyproject.toml and create a new tag with that version number and push it, this will trigger the release.yml GitHub Action.
git push origin <tag_name>
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
File details
Details for the file django_simple_ip_restrict-1.0.41.tar.gz
.
File metadata
- Download URL: django_simple_ip_restrict-1.0.41.tar.gz
- Upload date:
- Size: 2.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.8.16 Linux/5.15.0-1036-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4054578f2e6b79da6b130b70ce2a1f255142351f13dad75ffb811f2dca7ec15d |
|
MD5 | f5b8706c24be2540ca900b299bd64249 |
|
BLAKE2b-256 | 9b8a2a1992f0a35d7c5dd58f8d8571a466595e27a40aefde2b3b0679f714b513 |
File details
Details for the file django_simple_ip_restrict-1.0.41-py3-none-any.whl
.
File metadata
- Download URL: django_simple_ip_restrict-1.0.41-py3-none-any.whl
- Upload date:
- Size: 2.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.8.16 Linux/5.15.0-1036-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5dd54e92895ee8130979eb450c0c1bc62aa4e6a45220aefca12795942675427 |
|
MD5 | 3f09d9ed543a082f34129854bfe622e4 |
|
BLAKE2b-256 | 90356b5bb2f21514f86fcfc93539bea3c169370003fa1d6975a7f776c5b71f2a |