Add the following code to your onload function:
$(document).ajaxSend(function (event, jqxhr, settings) {
jqxhr.setRequestHeader("X-CSRFToken", '{{ csrf_token }}');
});
This way all AJAX requests will always get the csrftoken.
Regards,
Andréas
2015-02-09 16:19 GMT+01:00 Avraham Serour :
>
try addind the csrf on the http header instead of form data
On Sun, Feb 8, 2015 at 10:40 PM, G Z wrote:
> hello, I have an ajax request that sends a file to django, it is saying
> that the csrf token is missing but i copied my other ajax request that are
> working. I'm sure it has something to d
hello, I have an ajax request that sends a file to django, it is saying
that the csrf token is missing but i copied my other ajax request that are
working. I'm sure it has something to do with trying to pass a file to
upload.
I get a 403 and csrf missing return.
base.html
3 matches
Mail list logo