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

Uploaded Source

Built Distribution

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

Uploaded Source

File details

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

File metadata

  • Download URL: django_simple_ip_restrict-1.0.29.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.29.tar.gz
Algorithm Hash digest
SHA256 606c8f471d0922598b248d8b44a9c0ad889dc642d84a99fb77fee62fe5dcb574
MD5 512645d6a46be90e2360f2dc9f7ec48b
BLAKE2b-256 e35379f0f3b9c19a9a61010e328c93c5b957fdb2b2e746abdf0475192d6b2ad6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: django_simple_ip_restrict-1.0.29-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.29-py3.8.egg
Algorithm Hash digest
SHA256 3a04035710a4acb08354fcbe8ccc63ac7bd9a09a1b29aefae83938b1827e935f
MD5 65570e585a7f3f500a11c1f67f1ea8e3
BLAKE2b-256 3e42a120fc50d924113c76c6af374dc89b3295fca779bc73ad2541f1863ae7b9

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