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

Uploaded Source

Built Distribution

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

Uploaded Source

File details

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

File metadata

  • Download URL: django_simple_ip_restrict-1.0.33.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.33.tar.gz
Algorithm Hash digest
SHA256 adbadca83214858b640e0ef83c9a6897ce0579a7c90ba7e8fe4ae7769d359682
MD5 1546ce7755d41f42ca2bca2df5d7caf8
BLAKE2b-256 f4747585b8bf2e25a88beaa3ec982472b5129a0bed4529e02abff30621d1c7b2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: django_simple_ip_restrict-1.0.33-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.33-py3.8.egg
Algorithm Hash digest
SHA256 e65115d3b761ac8c59dad534765392ee937c7938924536d9ce400f048c5d4e29
MD5 b021d8e53f2d9a6b76aea428524078e7
BLAKE2b-256 9aa096ca953df086216343926736a6b18d01d085e19f3560acc3e3fdd03afd7e

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