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
File details
Details for the file django-block-ip-0.1.5.tar.gz
.
File metadata
- Download URL: django-block-ip-0.1.5.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a3ca2214a9241e19b4c854dec92e5ff9968f66da3b2e2b15cb48da00d9c065f0 |
|
MD5 | a3ca1df47ec2d30f442e943ee1ac6d67 |
|
BLAKE2b-256 | d5adc3887d3f55930a18738a40dd47ddb72fd636610a281f848e725ab1ed8a8a |