Skip to content

Instantly share code, notes, and snippets.

@elin3t
Last active September 30, 2015 09:37
Show Gist options
  • Save elin3t/8738112 to your computer and use it in GitHub Desktop.
Save elin3t/8738112 to your computer and use it in GitHub Desktop.
django ajax csft token
//query
$.ajax({
data: 'csrfmiddlewaretoken={{ csrf_token }}&...,
type: 'post',
});
//json
$.ajax({
data: {'csrfmiddlewaretoken': '{{ csrf_token }}', ...},
type: 'post',
dataType: 'json',
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment