更新时间:2022-12-18 22:16:10
您应该在名为X-CSRFToken"的 cookie 中发送 csrf 令牌,有一种方法可以使用 jQuery 全局启用此行为,如下所示:
You should send the csrf token in a cookie named "X-CSRFToken", there is a way to globally enable this behavior with jQuery like this:
https://docs.djangoproject.com/en/1.4/ref/contrib/csrf/#ajax