0

I have a problem with uwsgi and the CSRF verification. I have set up the domain in my settings.py like:

CSRF_TRUSTED_ORIGINS=['https://example.com']

and this also works with python manage.py runserver, but when I use uwsgi I get the error message:

Reason given for failure:

    Referer checking failed - https://example.com/ does not match any trusted origins.

It is actually complaining about the exact domain that I have setup in the CSRF_TRUSTED_ORIGINS list, how can that be? And why does it work with the django runserver?

Asara
  • 2,791
  • 3
  • 26
  • 55
  • Have a look at this https://stackoverflow.com/questions/38841109/csrf-validation-does-not-work-on-django-using-https . It seems you have the same issue. – glenfant Feb 25 '19 at 13:12
  • thanks, that was actually the problem. I already tested this out but I had a second problem with my environment vars which I passed but then did not check again without https://. Damn, you can post it as answer if you want to – Asara Feb 25 '19 at 13:52

0 Answers0