I am using Django 1.5, Apache, mod_wsgi and python 2.7, debian is hosted on linode.
Since I upgraded from django 1.3 to django 1.5, I started getting some error messages, for example: "ERROR (EXTERNAL IP): Internal Server Error: / feed /". Using this trace:
Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 92, in get_response response = middleware_method(request) File "/usr/local/lib/python2.7/dist-packages/django/middleware/common.py", line 57, in process_request host = request.get_host() File "/usr/local/lib/python2.7/dist-packages/django/http/request.py", line 72, in get_host "Invalid HTTP_HOST header (you may need to set ALLOWED_HOSTS): %s" % host) SuspiciousOperation: Invalid HTTP_HOST header (you may need to set ALLOWED_HOSTS): tadjenanet.montadamoslim.com
But, a few days ago, the volume of these errors increased significantly, and for a large number of URLs that I do not even have on my website.
I saw the answers here ( Invalid HTTP_HOST header in Django's SuspiciousOperation ) and I understand why I get this, but I need to know how to avoid this. server security.
source share