#27956: In DEBUG interface, the section "error during template rendering" 
doesn't
go inside an included template
------------------------------------------+------------------------
               Reporter:  Ling-Xiao Yang  |          Owner:  nobody
                   Type:  Bug             |         Status:  new
              Component:  Uncategorized   |        Version:  1.10
               Severity:  Normal          |       Keywords:
           Triage Stage:  Unreviewed      |      Has patch:  0
    Needs documentation:  0               |    Needs tests:  0
Patch needs improvement:  0               |  Easy pickings:  0
                  UI/UX:  0               |
------------------------------------------+------------------------
 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.

--
Ticket URL: <https://code.djangoproject.com/ticket/27956>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/055.67c21f000ed972b7dd16e791a9a0cac6%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to