ALLOWED_HOSTS and Django

If Django says:

Invalid HTTP_HOST header: 'bla-bla-bla.bla-bla-vla.com'. You may need to add u'bla-bla-bla.bla-bla-vla.com' to ALLOWED_HOSTS

then you need to add bla-bla-bla.bla-bla-vla.com, literally (or using a dot as a wildcard) to ALLOWED_HOSTS (docs).

Then reload Apache2 (not restart, reload) to verify changes have applied.


As I said in comments :

First option :

You have to write : ALLOWED_HOSTS=["bla-bla.com", "localhost", "127.0.0.1"] in settings.py file

Then, you just have to restart your server with :

sudo reboot

Or easily reload or restart apache2 service

service apache2 reload or service apache2 restart

It should work now ;)