I have a nice and beautiful Django site, but I noticed that my file error.logbecame huge, more than 150 MB after several months of life. It turns out that a bunch of spam bots look for known URL vulnerabilities (or something else) and fall into a bunch of subdirectories, such as http://mysite.com/ieor http://mysite.com/~admin.phpetc.
Since Django uses URL rewriting, it looks for patterns to match these requests, which throws an exception TemplateDoesNotExistand then a 500 message (Django does this, not me). I have debugging turned off, so they only receive a general 500 message, but it fills my logs very quickly.
Is there any way to disable this behavior? Or maybe just block IP to do this?
source
share