django-block-ip
                                
                                 django-block-ip copied to clipboard
                                
                                    django-block-ip copied to clipboard
                            
                            
                            
                        A simple django app to block IP addresses and masks.
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.
Usage
- pip install django-block-ip
- Add block_ipto yourINSTALLED_APPS.
- Add block_ip.middleware.BlockIPMiddlewareto yourMIDDLEWARE_CLASSES.
- Run syncdb.
- Add one or more entries to the BlockIPlist 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/).