I have never used FormData
so I don't know if that's the source of the problem or not. Anyway I would recommend you to change the code to somewhat like this:
$('#creation').on('submit', '#creation-form' , function (e) {
e.preventDefault();
var post_data = $(this).serialize();
console.log('POST data:' + post_data);
$.ajax({
url: '/create/',
data: post_data,
type: "POST",
success: function (resp) {
console.log(resp);
$('#creation').html(resp);
},
error: function (jqXHR, textStatus, errorThrown) {
console.log(jqXHR);
console.log(textStatus);
console.log(errorThrown);
}
processData: false,
contentType: false
});
});
If it doesn't work, check the console and you will know why it fails yourself.