Since upgrading to django 1.5 my logs show several SuspiciousOperation
exceptions with the text:
Invalid HTTP_HOST header (you may need to set ALLOW
In practice, just edit the file MyProjectName/settings.py
and add the host IP (IP address to the machine in which you're running Django) to the list ALLOWED_HOSTS
, which by default is empty.
So, in your, case we would have before the changes:
...
ALLOWED_HOSTS = []
...
After changes:
...
ALLOWED_HOSTS = ['168.62.208.14'] #Make sure your host IP is a string
...
Run the server again and you should be good. Here's an example using the port 8000:
python manage.py runserver 168.62.208.14:8000
. Now if you go to your browser and enter the address http://168.62.208.14:8000, you should find yourself in the page "Congratulations on your first Django-powered page".