I have an angular form that I want to submit via post request to my django backend. Regular wisdom for this is to use the following trick on your angluar app:
angularApp.config(['$httpProvider', function ($httpProvider) {
$httpProvider.defaults.xsrfCookieName = 'csrftoken';
$httpProvider.defaults.xsrfHeaderName = 'X-CSRFToken';
}]);
However, this requires your cookies are javascript accessible. How do you make post requests from angular to django work when you have the django setting CSRF_COOKIE_HTTPONLY = True
?
Note that this question could also be for how to use angular with django session-based csrf tokens (such as with https://github.com/mozilla/django-session-csrf), since this has the same problem of angular not being able to access the crsf token from the cookie.