I have a Django Rest Framework backend, where I make requests to from my AngularJs frontend, both are on different domains.
Currently I have the following settings in my Angular app:
//configure to work with django
$httpProvider.defaults.xsrfCookieName = 'csrftoken';
$httpProvider.defaults.xsrfHeaderName = 'X-CSRFToken';
Not surprisingly, on any post
request it returns a 403 error. I've been trying to figure this out, but have found nothing that works. What is the proper way of getting the csrf token, could it work with a mock get
request just to set the csrf token as a cookie? Am I missing anything in my current settings? Or should I change how I have my project set up?