更新时间:2022-12-18 22:20:12
您应该将csrf令牌发送到名为X-CSRFToken的cookie中,有一种方法可以通过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