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

Uploaded Source

Built Distribution

django_simple_ip_restrict-1.0.31-py3.8.egg (4.3 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: django_simple_ip_restrict-1.0.31.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for django_simple_ip_restrict-1.0.31.tar.gz
Algorithm Hash digest
SHA256 333eb54a260758c9a9e771797225e0eb0bdca4820a45d8f5a5140c3e693c05db
MD5 96ec8eb004ed424c5b21542031777056
BLAKE2b-256 db669fe3274ddbe30d7d90eaa09781cd26f4d70a6749bee4741d2a0a9eea0fdf

See more details on using hashes here.

File details

Details for the file django_simple_ip_restrict-1.0.31-py3.8.egg.

File metadata

  • Download URL: django_simple_ip_restrict-1.0.31-py3.8.egg
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for django_simple_ip_restrict-1.0.31-py3.8.egg
Algorithm Hash digest
SHA256 c227aa3c3a60b4b8049b68f3c64d661667e66572fab8986e7d206c3db34db570
MD5 160017b1852593540e15db2e12ac84fb
BLAKE2b-256 8b4ebe4d577a75feb7d8cc1ae3891ed6ab2b4e7c3c4949a40ccb0516fcd07fde

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