I'm implementing a django multi-site portal. I'm probing it and I get an "Invalid HTTP_HOST header" exception when I try to access a site domain that I have register in Sites model. Is it necessary to set the url in settings.ALLOWED_HOSTS too?
1 Answer
Yes, according to documentation:
A list of strings representing the host/domain names that this Django site can serve. This is a security measure to prevent HTTP Host header attacks, which are possible even under many seemingly-safe web server configurations.
Link for more info: https://docs.djangoproject.com/en/1.10/ref/settings/#allowed-hosts