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()))
原文地址:https://www.cnblogs.com/wtil/p/12674562.html