django框架里面使用render_to_response出现没有crsf_token问题

用render_to_response去加载模板好像会得不到csrf_token的值

使用render(request,'/path/',{'params':params})能得到

如果一定要用render_to_response,加个参数context_instance=RequestContext(request)就可以了

 

转载于:https://www.cnblogs.com/doosn777/p/8882768.html

你可能感兴趣的:(python)