4👍
I stumbled over this question because I had this error. In my case this didn’t happen randomly but I still think this could be helpful to people who find this question.
This error also appears in an nginx, gunicorn setup because nginx doesn’t pass a host header by default.
To solve this add the following to your nginx configuration:
proxy_set_header Host $host;
And you need to add the following to your settings.py
USE_X_FORWARDED_HOST = True
Source:stackexchange.com