#28050: TemplateSyntaxError should contain template name
-------------------------------------+-------------------------------------
Reporter: Petr | Owner: nobody
DlouhĂ˝ |
Type: New | Status: new
feature |
Component: Template | Version: 1.11
system | Keywords: TemplateSyntaxError
Severity: Normal | template
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
If there is an error in template, Django doesn't report the template name.
It could be quite uneasy to find the buggy template in such case.
e.g.: I have got following error:
{{{
File "/home/petr/soubory/programovani/Auto-
mat/DPNK/dpnk/env/lib/python3.5/site-packages/django/template/base.py",
line 509, in parse
self.invalid_block_tag(token, command, parse_until)
File "/home/petr/soubory/programovani/Auto-
mat/DPNK/dpnk/env/lib/python3.5/site-packages/django/template/base.py",
line 565, in invalid_block_tag
get_text_list(["'%s'" % p for p in parse_until], 'or'),
django.template.exceptions.TemplateSyntaxError: Invalid block tag on line
127: 'endblock', expected 'empty' or 'endthumbnail'. Did you forget to
register or load this tag?
}}}
It contains even line number, but I have no idea in which file.
I think, it is not that difficult to include template name in the bug
report. In my case I tried to debug the error call. In
`django.template.base`, the `invalidb_block_tag` is called from `parse()`
where the template name can be obtained from `self.origin.template_name`.
--
Ticket URL: <https://code.djangoproject.com/ticket/28050>
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/053.4c021080c2a1edcc929ba3f4a909ac67%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.