Skip to content

Instantly share code, notes, and snippets.

@mekanix
Created August 26, 2014 08:48
Show Gist options
  • Save mekanix/c088543eb3f223b4b64e to your computer and use it in GitHub Desktop.
Save mekanix/c088543eb3f223b4b64e to your computer and use it in GitHub Desktop.
<script>
$('#login').click(function() {
$.post(
"/",
{
username: $("#id_username").val(),
password: $("#id_password").val(),
csrfmiddlewaretoken: $.cookie("csrftoken"),
next: $("#id_next").val()
},
function() {
window.location.replace("/");
}
)
.fail(function(response, status) {
alert("Status: " + status + "\nResponse: " + response);
})
;
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment