Django KeyError at 'HTTP_HOST'

In my Django project sometimes I get two kinds of errors by mail and I don't know where they are coming from. So far I can see, the user is not logged in. First kind of error:

Internal Server Error: /
KeyError at /
'HTTP_HOST'
File "./core/views/iam.py", line 45, in prepare_django_request
'http_host': request.META['HTTP_HOST'],
Exception Type: KeyError at /
Exception Value: 'HTTP_HOST'
Request information:
USER: AnonymousUser

Second type of error:

Internal Server Error: /
OneLogin_Saml2_Error at /
SAML Response not found, Only supported HTTP_POST Binding

File "var/www/schoolbox/venv/lib64/python3.6/site-packages/onelogin/saml2/auth.py", line 139, in process_response
OneLogin_Saml2_Error.SAML_RESPONSE_NOT_FOUND
Exception Type: OneLogin_Saml2_Error at /
Exception Value: SAML Response not found, Only supported HTTP_POST Binding
Request information:
USER: AnonymousUser

But users are able to login but, or maybe only some, I don't know where this error is coming from. Maybe I need to post more code in order to help me. Any help will be appreciated.

Back to Top