On 25 March 2012 11:56, Homer <hi...@foxmail.com> wrote: > 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 %>
This line should be {% 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 django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.