Django throwing a 403 error (CSRF Cookie not set) despite token being passed in request header from React/Vite app
So my situation is that I have a form in a react frontend trying to post some data to a Django backend. When the Django view is CSRF exempt, all functionality is fine. However, when I remove the exemption decorator, Django always throws a 403 error – CSRF cookie not set.
Django throwing a 403 error (CSRF Cookie not set) despite token being passed in request header from React/Vite app
So my situation is that I have a form in a react frontend trying to post some data to a Django backend. When the Django view is CSRF exempt, all functionality is fine. However, when I remove the exemption decorator, Django always throws a 403 error – CSRF cookie not set.