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

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.2.tar.gz (2.2 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: django_simple_ip_restrict-1.0.2.tar.gz
  • Upload date:
  • Size: 2.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.4.3 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.0

File hashes

Hashes for django_simple_ip_restrict-1.0.2.tar.gz
Algorithm Hash digest
SHA256 e3158c43af98a4b11ca712c7ae59d1f40db149d0b9526a6679baa8e35fbe4175
MD5 3b2d1d0ff94fdea8bb462d5e5d07eaa4
BLAKE2b-256 4e9c7986deb3ccd29b0d7495a85a62bf268c468405f0d413c8099576c2ce1cde

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