TypeError: context must be a dict rather than Context.

翻译

上下文必须是一个字段,而不是一个Context实例对象

出处

html = t.render(Context({'current_date': now}))

解决

代码改为:

html = t.render({'current_date': now})

结果正常:

猜你喜欢

转载自blog.csdn.net/Da___Vinci/article/details/84291969