2
votes

I'm trying to display list of clinics but I keep getting the following error:

Exception Type: TemplateSyntaxError at /clinics/
Exception Value: Invalid block tag: 'c.name', expected 'empty' or 'endfor'

Here is the clinicList.html

{% for c in clinics %}
    {% c.name %}
{% endfor %}

here is the views

def clinicList(request):
    d = getVariables(request,dictionary={'page_name':""})
    d.update({'clinics': Clinic.objects.all()})

    return render(request, 'm1/clinicList.html', d)

here is url.py

url(r'^clinics/$', views.clinicList, name='clinicList'),
1
shouldn't it be {{ c.name }} - jcfollower
Thanks a lot! Can't believe I made such a trivial mistake. You can post it as an answer and I can mark it checked - James L.
Everyone needs that kind of help now and then. - jcfollower

1 Answers

9
votes

Looks like you should have {{ c.name }}