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

Uploaded Source

Built Distribution

django_simple_ip_restrict-1.0.23-py3.7.egg (4.3 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: django_simple_ip_restrict-1.0.23.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/41.1.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.3

File hashes

Hashes for django_simple_ip_restrict-1.0.23.tar.gz
Algorithm Hash digest
SHA256 42be9ec0fa6c07a9ec3a320d7f8059b3780927df9a29eb591bbfc95da8cb1af1
MD5 d4660fc6dd6c43c49cc95e9f4690fd72
BLAKE2b-256 edd5a2d782451c327740edbd7317c26842e9cd20381d200ae2015f4c32078f8e

See more details on using hashes here.

File details

Details for the file django_simple_ip_restrict-1.0.23-py3.7.egg.

File metadata

  • Download URL: django_simple_ip_restrict-1.0.23-py3.7.egg
  • Upload date:
  • Size: 4.3 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.45.0 CPython/3.7.0

File hashes

Hashes for django_simple_ip_restrict-1.0.23-py3.7.egg
Algorithm Hash digest
SHA256 ed5c74a46fefab556a42db3fc002f2b686e68757fb48e2bc12b821bad1318603
MD5 fe1e2c0c11a8a87178d8a7a7cefd11c9
BLAKE2b-256 465ebd9e1a767f8c0000c9d6dbdff1f3efe6352e47c3d89a59d13f0ad0b89e5c

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