Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_simple_ip_restrict-1.0.45.tar.gz (2.1 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file django_simple_ip_restrict-1.0.45.tar.gz.

File metadata

File hashes

Hashes for django_simple_ip_restrict-1.0.45.tar.gz
Algorithm Hash digest
SHA256 c1217daa054fd4dd09ceb9b6ad3c867fbc862bfcba6ecd479330bafa79d0efd0
MD5 e053437ecb5d89d5c8094602b2f0c712
BLAKE2b-256 bc677573288a998aac570098d6b6eb369e00fcf2223ee344e6f8d5c69019afc8

See more details on using hashes here.

File details

Details for the file django_simple_ip_restrict-1.0.45-py3-none-any.whl.

File metadata

File hashes

Hashes for django_simple_ip_restrict-1.0.45-py3-none-any.whl
Algorithm Hash digest
SHA256 a941232ed5a3f44e88c196be2cabc385de356b2a0fb3ae83786c90381ca86872
MD5 eb2ed6b7ffe470b104f956f5666f101d
BLAKE2b-256 b9d52eb544e9cdc7b438d476827f0d81d335e9b9f996eb555996de034f225fce

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page