跨站请求伪造

跨站请求伪造

veiw中
from django.template.context import RequestContext  导入RequestContext模块
 
return render_to_response('login.html',data,context_instance=RequestContext(request))  

html中设置Token:
  {% csrf_token %}
原文地址:https://www.cnblogs.com/fengjian2016/p/5374657.html