id summary reporter owner description type status component version severity resolution keywords cc stage has_patch needs_docs needs_tests needs_better_patch easy ui_ux 128 IndexError when using invalid {% extends %} in template should be replaced with better error message. espen@… Adrian Holovaty "First of all the error {{{ There's been an error: Traceback (most recent call last): File ""/usr/lib/python2.4/site-packages/django/core/handlers/wsgi.py"", line 190, in get_response return callback(request, **param_dict) File ""/home/espen/django/blog/apps/blog/views/blog.py"", line 20, in details return HttpResponse(t.render(c)) File ""/usr/lib/python2.4/site-packages/django/core/template.py"", line 116, in render return self.nodelist.render(context) File ""/usr/lib/python2.4/site-packages/django/core/template.py"", line 437, in render bits.append(node.render(context)) File ""/usr/lib/python2.4/site-packages/django/core/template_loader.py"", line 80, in render parent_is_child = isinstance(compiled_parent.nodelist[0], ExtendsNode) IndexError: list index out of range }}} The template file that trys to extend base.html: {{{ {% extends ""base"" %} {% block title %} Espen Grindhaug - Blog - {{ obj.headline }} {% endblock %} {% block content %}

{{ obj.headline }}

{{ obj.summary }}

{{ obj.body }}

By {{ obj.author }} ({{ obj.pub_date }})

{% endblock %} }}} The weird thing here is that I get exactly the same error with completly different child template. base.html (the same as in [http://www.djangoproject.com/documentation/templates/#template-inheritance URL]): {{{ {% block title %}Espen Grindhaug{% endblock %}
{% block sidebar %} {% endblock %}
{% block content %}{% endblock %}
}}} The details function in blog.py that loads the template: {{{ def details(request, slug): try: obj = entries.get_object(slug__exact=slug) except entries.EntryDoesNotExist: raise Http404 t = template_loader.get_template('blog/details') c = Context(request, { 'obj':obj,}) return HttpResponse(t.render(c)) }}} " defect closed Template system normal worksforme Accepted 0 0 0 0