postman CSRF问题

app下创建 csrf_disable.py

在该文件中:

from rest_framework.authentication import SessionAuthentication
class CsrfExemptSessionAuthentication(SessionAuthentication):
def enforce_csrf(self, request):
return
视图中的SessionAuthentication用CsrfExemptSessionAuthentication代替
原文地址:https://www.cnblogs.com/yushengzhou/p/9913944.html