﻿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
27956	Template error raised in an {% extends %}  parent template shows incorrect source location on debug page	Ling-Xiao Yang	nobody	"Please see comment:2 for updated description. Below is the original description.

================================================

Hello,

It seems that this problem only concerns Django 1.9 and 1.10. The problem has been fixed in the newest 1.11b1, but I am not sure if it has been backported to older versions.

How to verify:
1. Start a new Django project, create two template html files, and make sure that template A uses `{% include %} tag to include the content of template B.
2. Make an error inside template B. For example, in the screenshots below, I am passing in a model `Question` and using `{{ Question.objects.all }}` in template B (inner.html) to trigger an error.
3. Complete a view function that renders template A, and add a url route for it. Try access this route with DEBUG=True.
4. You will see the debug interface. In the section ""Error during template rendering,"" you will see the error line being highlighted. The position and line number will be correct, but the error will be pointed to template A, while it should be pointed to template B where it actually happens.

Expected behavior:
I attached two screenshots, showing the expected behavior (using Django 1.11b1 and 1.8.11) and the actual behavior (using Django 1.10.6).

Note:
I discovered this problem while investigating the issue 902 of Django debug toolbar (on GitHub).
It is acceptable to invalidate this ticket if the fix has been ported to the branch Django 1.10.x, or it is mentioned elsewhere in the documentation."	Bug	closed	Template system	dev	Normal	fixed		ling-xiao.yang@…	Accepted	1	0	0	0	0	0
