I tried to create an index webpage but Django told me I had a template
error:
Invalid block tag: 'endblock', expected 'empty' or 'endfor'
Here is the code of index.html:
{% extends "base.html" %}
{% block title %}Home{% endblock %}
{% block content %}
<h2>Welcome to So Easy! 学中文</h3>
<h3>Showcase</h3>
<table>
<tr>
{% for item in item_list|slice:":3" %}
<td>
<a href="{{ item.get_absolute_url }}"><b>{{ item.name }}</b><br />
{% if item.photo_set.count %}
<img src="{{ item.photo_set.all.0.image.thumb_url }}" />
{% else %}
<span>No Photos (yet)</span>
{% endif %}
</a>
</td>
<% endfor %>
</tr>
</table>
<p><a href="{% url item_list %}">View the full list;</a></p>
{% endblock %} #Error Here
{% block footer %}
I hope someone can help me. Thanks!
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/django-users/-/Dn_zBeC7tnYJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.