Skip to main content

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/).

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

Uploaded Source

File details

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

File metadata

File hashes

Hashes for django-block-ip-0.2.0.tar.gz
Algorithm Hash digest
SHA256 2195c067124ae3e15f10d2294895c4e4cae1df05cc6d904a0142bc3cf4bfc5bb
MD5 9cf8d446c6c88ca21c3f606f5fc5939f
BLAKE2b-256 139db32b44199383ea90158128e8c18e10fa34a1732f63d8a9dea24e3276491f

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.0 This release

1 file

0.1.6

1 file

0.1.5

1 file

0.1.4

2 files

0.1.3

2 files

0.1.2

1 file

0.1.1

1 file

0.1.0

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page