Error in logs django.core.exceptions.ImproperlyConfigured
Closed this issue · 2 comments
This error seems to be repeating constantly in the logs
django.core.exceptions.ImproperlyConfigured: CSRF_USE_SESSIONS is enabled, but request.session is not set. SessionMiddleware must appear before CsrfViewMiddleware in MIDDLEWARE.
There seems to be another exception before that
django.core.exceptions.DisallowedHost: Invalid HTTP_HOST header: 'mozilla-pontoon.herokuapp.com'. You may need to add 'mozilla-pontoon.herokuapp.com' to ALLOWED_HOSTS.
Interestingly enough, there seems to be an old issue about this (#2245).
We've changed the configuration for ALLOWED_HOSTS
recently.
The value was set to pontoon.mozilla.org, mozilla-pontoon.herokuapp.com
, but it should be pontoon.mozilla.org,mozilla-pontoon.herokuapp.com
(no space).
We should check out what libraries exist for reading environment variables into Django settings and handling things like specific data types (lists, booleans).