Skip to main content

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

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

Uploaded Source

Built Distribution

django_simple_ip_restrict-1.0.34-py3.8.egg (4.3 kB view hashes)

Uploaded Source

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