我尝试将数据插入我的模板
data = Bill.bill_data(self)
return render_template('templates/bill.html', **data)
票据模板在文件夹模板中的位置。但我有个错误
jinja2.exceptions.TemplateNotFound: templates/bill.html
我的数据如下:
data={
"payer_currency": "5",
"shop_amount": "5",
"shop_currency": "5",
"shop_id": "5",
"shop_order_id": "12",
"sign": ""
}
您不必在路径中添加
templates/
。默认情况下,render_template
搜索文件夹templates
中的模板相关问题 更多 >
编程相关推荐