render_to_string() got an unexpected keyword argument 'context_instance'的解决方法

来源:互联网 发布:照片缩小软件手机 编辑:程序博客网 时间:2024/06/06 06:43

这里写图片描述


参考资料:

render_to_string() got an unexpected keyword argument ‘status’

TypeError at /post/ render_to_response() got an unexpected keyword argument ‘context_instance’

Django error: render_to_response() got an unexpected keyword argument ‘context_instance’

The context_instance parameter in render_to_response was deprecated in Django 1.8, and removed in Django 1.10.
The solution is to switch to the render shortcut, which automatically uses a RequestContext. Update your imports and view as follows. Note that render takes the request object as its first argument.


查看了一下 源码:

这里写图片描述

这里写图片描述

改一下参数就好了

4 0
原创粉丝点击