JQuery + AJAX + Django = CSRF ? [duplicate]
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: "CSRF token missing or incorrect" while post parameter via AJAX in Django I wanted to send login data by AJAX to authenticate user, but it wasn't possible because of CSRF. Could You tell me what to add to my code to make it woking? my JavaScript file: $("#login").live("click", function() { var username = $(".login_username").val(); var password = $(".login_password").val(); $.ajax({ url: "/login", type: "POST",