Answer the question
In order to leave comments, you need to log in
How to send PUT request in Django (getting CSRF token missing or incorrect error)?
I'm trying to send an ajax request with PUT and I get a CSRF token missing or incorrect response:
console.log(data);
$.ajax({
type: 'PUT',
url: '/comment/',
data: data,
dataType: 'json',
success: function (response) {
add_comments(response)
},
error: function (response) {},
// complete: function () {
// console.log("END")
// }
});
console logbefore sending the object lies
Object { csrfmiddlewaretoken: "cU8JiH3uSdPNXyxxO5ss3GWnRldzQMfj9DGAuvv2OFgLSdbwa63acXVld2CVOFmH", post: 14, comment_title: "666666", comment_text: "777777" }
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question