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

Uploaded Source

Built Distribution

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

Uploaded Source

File details

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

File metadata

  • Download URL: django_simple_ip_restrict-1.0.39.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.1 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.39.tar.gz
Algorithm Hash digest
SHA256 59b93cc343b954b5ac12b5242b02193c25e55e19e71279492b279ab11b66aa13
MD5 99f5f3cd64e8d31d094355e547e77fb9
BLAKE2b-256 055fc71c692f5a0dbf1bdc56aeafe1c0c840cfaa2b1e46940c2391b32edbfa9e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: django_simple_ip_restrict-1.0.39-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.1 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.39-py3.8.egg
Algorithm Hash digest
SHA256 f3ddf0f46bd79990af3debb15843d7923831c924532d1340f236eb0541322e65
MD5 5d9724950ec68f6bd0f8944883b82602
BLAKE2b-256 03754db750cc1734a4541a7e7fef03aeef8f7be1cb92e76dc1a8e3f4e15c6e1b

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