django2.2 context must be a dict rather than Context.错误解决方法

nodes.append(loader.render_to_string('xadmin/blocks/erpaddbookmarks.html', context=context))
# 报错
# context must be a dict rather than Context.

# 解决方法
nodes.append(loader.render_to_string('xadmin/blocks/erpaddbookmarks.html', context=context.flatten()))

 

posted on 2020-04-10 16:58  信奉上帝的小和尚  阅读(751)  评论(0编辑  收藏  举报

导航