Categories
Programming & Web Development

Avoid Django’s invalid HTTP_HOST error message

I have several Django projects published, and I constantly get my email inbox and log files inundated with errors of spiders and hack attempts to connect to my applications. Those error messages have the email subject: “[Django] ERROR (EXTERNAL IP): Invalid HTTP_HOST …”. This is due to a Django’s security setting ALLOWED_HOSTS to prevent attacks. […]