首页 > 其他分享 >render_to_string() got an unexpected keyword argument 'context_instance'的解决方法

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

时间:2023-06-06 20:04:04浏览次数:52  
标签:unexpected string render argument instance keyword got


render_to_string() got an unexpected keyword argument


参考资料:

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.


查看了一下 源码:

render_to_string() got an unexpected keyword argument

render_to_string() got an unexpected keyword argument

改一下参数就好了


标签:unexpected,string,render,argument,instance,keyword,got
From: https://blog.51cto.com/u_16152603/6427431

相关文章