postman CSRF问题
app下创建 csrf_disable.py
在该文件中:
from rest_framework.authentication import SessionAuthentication视图中的SessionAuthentication用CsrfExemptSessionAuthentication代替
class CsrfExemptSessionAuthentication(SessionAuthentication):
def enforce_csrf(self, request):
return
 
                    
                     
                    
                 
                    
                 
                
            
         浙公网安备 33010602011771号
浙公网安备 33010602011771号 
