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

Uploaded Source

Built Distribution

django_block_ip-0.1.4-py2.7.egg (5.2 kB view details)

Uploaded Source

File details

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

File metadata

File hashes

Hashes for django-block-ip-0.1.4.tar.gz
Algorithm Hash digest
SHA256 52c2584c87e40114f4164fd55218aa8b62e243c32f628e3b42167aeef0efdd0d
MD5 ed330bf9fd82c4d1f973777ddc612398
BLAKE2b-256 41496601aaa1024cfe287a380209eff20dd0608113c98e865cd54aeaf54679f5

See more details on using hashes here.

File details

Details for the file django_block_ip-0.1.4-py2.7.egg.

File metadata

File hashes

Hashes for django_block_ip-0.1.4-py2.7.egg
Algorithm Hash digest
SHA256 46cfdb01f133f9fe7801dfcb2fe3266bb0c1ce81400a2aba176d7614eb5e84b4
MD5 f9b2303c2bfc51e0d52b32509115bfe3
BLAKE2b-256 868d01e405ca254b86a095f424be9e6344db904ccee800e4102fa70f5b86c940

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