postman CSRF问题

app下创建 csrf_disable.py

在该文件中:

from rest_framework.authentication import SessionAuthentication
class CsrfExemptSessionAuthentication(SessionAuthentication):
def enforce_csrf(self, request):
return
视图中的SessionAuthentication用CsrfExemptSessionAuthentication代替

 

posted on 2018-11-06 10:48  工大只有一个阿锤  阅读(1302)  评论(0编辑  收藏  举报

导航