Skip to main content

Simple IP and IP-range blocking for Django

Project description

This is a simple application to restrict access by IP address. There’s a few other apps that do this out there, but they tend to have other features such as rate limiting. I think it’s best to leave rate-limiting to rate-limiting specific apps, so this just blocks IPs.

Usage

  • pip install django-block-ip

  • Add block_ip to your INSTALLED_APPS.

  • Add block_ip.middleware.BlockIPMiddleware to your MIDDLEWARE_CLASSES.

  • Run syncdb.

  • Add one or more entries to the BlockIP list in the admin. You can just enter a single IP or use a network mask, like this: 213.67.43.0/24

Acknowledgments

This is based on http://github.com/svetlyak40wt/django-ban, which was based on the Justquick’s django snippet (http://www.djangosnippets.org/snippets/725/).

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-block-ip-0.1.3.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file django-block-ip-0.1.3.tar.gz.

File metadata

File hashes

Hashes for django-block-ip-0.1.3.tar.gz
Algorithm Hash digest
SHA256 82b22b638c49d652341c213b422b95937ddc4e06854512a6ce9b3bd217f2d584
MD5 95d3fe7db3e77fcea6bad130277df599
BLAKE2b-256 979e5ee46f95eaa9e91f91e1770d7a9bea30becf51f9077b19bbc0ea55e4d4e9

See more details on using hashes here.

File details

Details for the file django-block-ip-0.1.3.macosx-10.9-x86_64.tar.gz.

File metadata

File hashes

Hashes for django-block-ip-0.1.3.macosx-10.9-x86_64.tar.gz
Algorithm Hash digest
SHA256 f190bb9ca53113a80e4de636156bb4faa065b7b9189a0e99777cb277cfef6577
MD5 d7decabb6e06afcd8c37ba82da451806
BLAKE2b-256 ded2fee390d847f8f15ee57c2eac74bd5280e6491d712580f5b09d8401dd9411

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