您的位置:首页 > 编程语言 > Go语言

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

2017-04-21 11:27 1731 查看


参考资料:

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.

查看了一下 源码:





改一下参数就好了
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐