• 2022-05-31
    假设有视图函数[br][/br] defindex(request): context={} context['htmlVar']='Django教程' context['htmlList']=['教程1','教程2','教程3','教程4'] returnrender(request,'app01/index.html',context)[br][/br] 则app01/index.html中如何在页面上输出内容'教程1','教程2','教程3','教程4'
    A: {% for var in htmlList%} 条目值:{{var}} {% endfor %}
    B: forvarinhtmlList 条目值:{{var}} endfo