django-block-ip
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/).
Metadata
Release files for django-block-ip 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django-block-ip-0.2.0.tar.gz | 3.8 kB | Without provenance | Details for django-block-ip-0.2.0.tar.gz |
Release files / django-block-ip-0.2.0.tar.gz
| Download URL | django-block-ip-0.2.0.tar.gz |
|---|---|
| Size | 3.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2195c067124ae3e15f10d2294895c4e4cae1df05cc6d904a0142bc3cf4bfc5bb
|
|
BLAKE2b-256 checksum How to use checksums |
139db32b44199383ea90158128e8c18e10fa34a1732f63d8a9dea24e3276491f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for django-block-ip 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.