James L.
James L.

Reputation: 1153

Django Invalid block tag expected 'empty' or 'endfor'

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

Upvotes: 2

Views: 7481

Answers (1)

jcfollower
jcfollower

Reputation: 3158

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

Upvotes: 10

Related Questions