我试图显示诊所列表,但我一直收到以下错误:
Exception Type: TemplateSyntaxError at /clinics/
Exception Value: Invalid block tag: 'c.name', expected 'empty' or 'endfor'
这是clinicList.html
{% for c in clinics %}
{% c.name %}
{% endfor %}
这是观点
def clinicList(request):
d = getVariables(request,dictionary={'page_name':""})
d.update({'clinics': Clinic.objects.all()})
return render(request, 'm1/clinicList.html', d)
这是url.py
url(r'^clinics/$', views.clinicList, name='clinicList'),
答案 0 :(得分:8)
看起来你应该有{{ c.name }}