1. 程式人生 > >跨站點請求偽造保護

跨站點請求偽造保護

from django.shortcuts import render_to_response from django.template.context_processors import csrf def my_view(request): c = {} c.update(csrf(request)) # ... view code here return render_to_response("a_template.html", c)