您的位置:首页 > 产品设计 > UI/UE

django异常:CSRF verification failed. Request aborted.的解决方案

2013-10-15 09:49 561 查看
方案1:取消CSRF(参见:/article/6090246.html

from django.views.decorators.csrf import csrf_exempt

@csrf_exempt
def index(request):


方案2:使用render方法(不能使用render_to_response)(参见:http://stackoverflow.com/questions/10388033/csrf-verification-failed-request-aborted

def index(request):
return render(request, 'note/index.html', {'Name':"Guys"})
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: