【发布时间】:2018-08-07 01:43:43
【问题描述】:
我正在学习 django rest。现在我不会在 html 中输出一些 json 数据。我的json:
{'Resul': {'Period Start': '2017-01-01', 'Period End': '2017-12-12'}}
然后我将它的 json 发送到 html:
context = {'Resul': json_data['date']}
content = render_to_string('balance.html', context)
json_data['date'] - {'Period Start': '2017-01-01', 'Period End': '2017-12-12'}
在html中我写了这段代码
Period: {{ Resul['Period Start'] }} - {{ Resul['Period End'] }}
但有错误:
Could not parse the remainder: '['Period Start']' from 'Resul['Period Start']'
【问题讨论】:
-
@iklinac 不,不重复。我自己创造的