Skip to main content

Apply an IP restriction to specific routes

Project description


This middleware allows you to mark Django URL namespaces as unavailable to all requests except those coming from a whitelisted IP subnet.


Add to the list of MIDDLEWARE:


Then you can set the following keys on

  • IP_PROTECTED_NAMESPACES: list of namespaces to block (default: ["admin"])
  • IP_NETWORKS_WHITELIST: list of subnets to allow, in CIDR notation

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.40.tar.gz (2.5 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page