简单记录一下:
ajax 用post时,报错:
You called this URL via POST, but the URL doesn't end in a slash and you have APPEND_SLASH set. Django can't redirect to the slash URL while maintaining POST data.
原因:url要以/结尾。
// 以下报错
$.ajax({
url: "/test",
type: "post",
...
//改成下面这样就行了
$.ajax({
url: "/test/",
type: "post",
...