我正在尝试显示诊所列表,但不断收到以下错误:
Exception Type: TemplateSyntaxError at /clinics/
Exception Value: Invalid block tag: 'c.name', expected 'empty' or 'endfor'
这是诊所名单.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'),
看起来你应该有{{ c.name }}