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

Uploaded Source

Built Distribution

django_simple_ip_restrict-1.0.26-py3.7.egg (4.4 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: django_simple_ip_restrict-1.0.26.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.26.tar.gz
Algorithm Hash digest
SHA256 6b177dcdf396883cf6400b8704bbf709cf8ca45abde2d97e9712ef8c3ed28ebd
MD5 ac2bf4e73f2034dbac5fa1f77a9da112
BLAKE2b-256 e13bd10dcb8e3807bfa159a5cea7df797c7aec87b81527f43a1dfa4037d7cd3a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: django_simple_ip_restrict-1.0.26-py3.7.egg
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/40.4.3 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.7.0

File hashes

Hashes for django_simple_ip_restrict-1.0.26-py3.7.egg
Algorithm Hash digest
SHA256 2c5bebd524f652c7f012790118c7c31cedfa05473e06246fcf473ad439fc169b
MD5 baf19b02c935c446eb6dc9c48cef7b9b
BLAKE2b-256 83eceabfe63d03cf0a9d2f750be1b16f1efe4017021b277c4f4736ac9797aaa1

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