Created
February 22, 2010 22:49
-
-
Save yeago/311619 to your computer and use it in GitHub Desktop.
middleware which serves suspicious IPs a message
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class IPBot: | |
def process_request(self,request): | |
if request.META.get('REMOTE_ADDR') in getattr(settings,'SUSPECTED_BOTS',[]): | |
return HttpResponse("Hi. I'm not sure what you're doing, but if you'd like to continue doing it, please email me - [email protected]") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment