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

Uploaded Source

Built Distribution

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

Uploaded Source

File details

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

File metadata

  • Download URL: django_simple_ip_restrict-1.0.24.tar.gz
  • Upload date:
  • Size: 2.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.24.tar.gz
Algorithm Hash digest
SHA256 dcd2cd2fa1aa0db68f4b18757f014c8a0d8c5a475a5b69e8daa60994175e7957
MD5 ebd3672e626d046d62084838f749c040
BLAKE2b-256 d5b9f459b52a65134b7fc3720fe4f41a6a7b2cfd09b8b8db67e90cff1cfc94f0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: django_simple_ip_restrict-1.0.24-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.24-py3.7.egg
Algorithm Hash digest
SHA256 beddb23b4b660097bd123db9ba21b1630d04f3cef767fb89048de3879f249af9
MD5 bd6f3ba8bfd998b38fab1cd8d56fbea2
BLAKE2b-256 5745b5089179b38912025391f8e38f893e8b403f842b0a6573ff7b55fd4e2172

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