当我打开 session 身份验证时,根据: https://django-tastypie.readthedocs.org/en/latest/authentication_authorization.html 我需要csrf。 我怎样才能暂时关闭它? 我看到类似https://django-tastypie.readthedocs.org/en/latest/cookbook.html?highlight=csrf#determining-format-via-url的东西 我想我需要重写除wrap_view之外的另一种方法,并且除了@csrf_exempt之外什么都不做。 Google 确实没有向我返回任何内容。
最佳答案
我遇到了同样的问题,我通过重写 SessionAutentication 方法解决了它。
关于csrf - 如何关闭 tastypie 帖子中的 csrf?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14667951/