Django预期无效的块标记'空'或者' endfor'

时间:2014-11-19 18:14:01

标签: python django

我试图显示诊所列表,但我一直收到以下错误:

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'),

1 个答案:

答案 0 :(得分:8)

看起来你应该有{{ c.name }}