djangosnippets.org: Latest snippets posted by pillhttps://djangosnippets.org/users/pill/2008-05-07T17:56:50.633172-05:00pillBlock IP addresses
2008-05-07T17:56:50.633172-05:00pillhttps://djangosnippets.org/snippets/744/<p>I needed a quick and dirty way to block a user from my site. </p>
<p>Just include this middleware class under the 'MIDDLEWARE_CLASSES' variable in your settings.py file.</p>
<p>Also include the variable BLOCKED_IPS = ('123.123.123.123',) variable, where the value is a tuple of IP addresses you want blocked from your site.</p>
Freely redistributable