Monday, November 21, 2022

ALLOWED_HOSTS error

My Django log is full of these errors ...

ERROR /usr/local/lib/python3.10/dist-packages/django/core/handlers/exception.py TIME: 2022-09-28 00:13:17,204 MSG: exception.py:response_for_exception:99 Invalid HTTP_HOST header: '111.222.333.444'. You may need to add '111.222.333.444' to ALLOWED_HOSTS.

... where '111.222.333.444. is the correct IP address of the FQDN for the site.

Everything seems to be working but these errors are just consuming disk space.

My reading of the docs https://docs.djangoproject.com/en/3.2/ref/settings/#allowed-hosts does not indicate the IP address should be in ALLOWED_HOSTS.

My inclination is it shouldn't be there.

What is the correct way to deal with this?

Many thanks

Mike

--   Signed email is an absolute defence against phishing. This email has  been signed with my private key. If you import my public key you can  automatically decrypt my signature and be sure it came from me. Just  ask and I'll send it to you. Your email software can handle signing.  

No comments:

Post a Comment