Skip to content Skip to sidebar Skip to footer

Django Nginx Getting Csrf Verification Error In Production Over Http

I've just deployed my django project on AWS with nginx. Everything works well except for when when I try to make any POST requests (over just http), I get the error: 'Forbidden (

Solution 1:

When you're issuing posts from javascript, ensure that settings.CSRF_COOKIE_HTTPONLY is set to False

Snippet from [1]: "Whether to use HttpOnly flag on the CSRF cookie. If this is set to True, client-side JavaScript will not to be able to access the CSRF cookie."

[1] https://docs.djangoproject.com/en/2.0/ref/settings/#csrf-cookie-httponly


Post a Comment for "Django Nginx Getting Csrf Verification Error In Production Over Http"