#12787: TemplateDoesNotExist exception does not report the correct template_name
--------------------------------------+-------------------------------------
          Reporter:  trigeek38        |         Owner:  nobody              
            Status:  new              |     Milestone:  1.2                 
         Component:  Template system  |       Version:  SVN                 
        Resolution:                   |      Keywords:  TemplateDoesNotExist
             Stage:  Accepted         |     Has_patch:  0                   
        Needs_docs:  0                |   Needs_tests:  0                   
Needs_better_patch:  0                |  
--------------------------------------+-------------------------------------
Changes (by kmtracey):

  * needs_better_patch:  => 0
  * stage:  Unreviewed => Accepted
  * needs_tests:  => 0
  * needs_docs:  => 0

Old description:

> When calling templateA which {% includes templateB %} that does not
> exist, the exception reports that templateA does not exist instead of
> templateB.  Version (1, 1, 0, 'final', 0) reported the correct
> template_name.
>
> ### This is how 1.1.0 reported templates that did not exist when called
> by {% include %} in another template.
>
> _order_detail.html included in order_detail.html located at /orders/650/
>

> TemplateDoesNotExist at /orders/650/
>
> _order_detail.html
>
> Request Method:         GET
> Request URL:  somewhere/outside/orders/650/
> Exception Type:         TemplateDoesNotExist
> Exception Value:
>
> _order_detail.html
>
> Exception Location:     /usr/lib/python2.4/site-
> packages/django/template/loader.py in find_template_source, line 74
> Python Executable:      /usr/bin/python
> Python Version:         2.4.3
>

> ## This is how trunk reports the same situation.  Notice here that it
> reports that the actual template being called by the view as not existing
> instead of the included template.  Here I included _order_detail.html
> (does not exist) in po_form.html
>
> pos/po_form.html
>
> Request Method:         GET
> Request URL:    somewhere/else/pos/new/
> Exception Type:         TemplateDoesNotExist
> Exception Value:
>
> pos/po_form.html
>
> Exception Location:
> /home/trigeek38/lib/python2.5/django/template/loader.py in find_template,
> line 125
> Python Executable:      /usr/local/bin/python
> Python Version:         2.5.4
> Python Path:
> ['/home/trigeek38/lib/python2.5/html5lib-0.11.1-py2.5.egg',
> '/home/trigeek38/lib/python2.5/pisa-3.0.30-py2.5.egg',
> '/home/trigeek38/lib/python2.5/django_pagination-1.0.5-py2.5.egg',
> '/home/trigeek38/lib/python2.5',
> '/home/trigeek38/webapps/django_trunk/lib/python2.5',
> '/usr/local/lib/python25.zip', '/usr/local/lib/python2.5',
> '/usr/local/lib/python2.5/plat-linux2', '/usr/local/lib/python2.5/lib-
> tk', '/usr/local/lib/python2.5/lib-dynload', '/usr/local/lib/python2.5
> /site-packages', '/usr/local/lib/python2.5/site-packages/PIL',
> '/home/trigeek38/webapps/django_trunk/projects/',
> '/home/trigeek38/webapps/django_trunk/projects/']
> Server time:    Thu, 4 Feb 2010 21:43:40 -0500
> Template-loader postmortem
>
> Django tried loading these templates, in this order:
>
>     * Using loader django.template.loaders.filesystem.Loader:
>     * Using loader django.template.loaders.app_directories.Loader:

New description:

 When calling templateA which {% includes templateB %} that does not exist,
 the exception reports that templateA does not exist instead of templateB.
 Version (1, 1, 0, 'final', 0) reported the correct template_name.

 ### This is how 1.1.0 reported templates that did not exist when called by
 {% include %} in another template.

 _order_detail.html included in order_detail.html located at /orders/650/

 {{{
 TemplateDoesNotExist at /orders/650/

 _order_detail.html

 Request Method:         GET
 Request URL:  somewhere/outside/orders/650/
 Exception Type:         TemplateDoesNotExist
 Exception Value:

 _order_detail.html

 Exception Location:     /usr/lib/python2.4/site-
 packages/django/template/loader.py in find_template_source, line 74
 Python Executable:      /usr/bin/python
 Python Version:         2.4.3
 }}}

 ## This is how trunk reports the same situation.  Notice here that it
 reports that the actual template being called by the view as not existing
 instead of the included template.  Here I included _order_detail.html
 (does not exist) in po_form.html
 {{{
 pos/po_form.html

 Request Method:         GET
 Request URL:    somewhere/else/pos/new/
 Exception Type:         TemplateDoesNotExist
 Exception Value:

 pos/po_form.html

 Exception Location:
 /home/trigeek38/lib/python2.5/django/template/loader.py in find_template,
 line 125
 Python Executable:      /usr/local/bin/python
 Python Version:         2.5.4
 Python Path:
 ['/home/trigeek38/lib/python2.5/html5lib-0.11.1-py2.5.egg',
 '/home/trigeek38/lib/python2.5/pisa-3.0.30-py2.5.egg',
 '/home/trigeek38/lib/python2.5/django_pagination-1.0.5-py2.5.egg',
 '/home/trigeek38/lib/python2.5',
 '/home/trigeek38/webapps/django_trunk/lib/python2.5',
 '/usr/local/lib/python25.zip', '/usr/local/lib/python2.5',
 '/usr/local/lib/python2.5/plat-linux2', '/usr/local/lib/python2.5/lib-tk',
 '/usr/local/lib/python2.5/lib-dynload', '/usr/local/lib/python2.5/site-
 packages', '/usr/local/lib/python2.5/site-packages/PIL',
 '/home/trigeek38/webapps/django_trunk/projects/',
 '/home/trigeek38/webapps/django_trunk/projects/']
 Server time:    Thu, 4 Feb 2010 21:43:40 -0500
 Template-loader postmortem

 Django tried loading these templates, in this order:

     * Using loader django.template.loaders.filesystem.Loader:
     * Using loader django.template.loaders.app_directories.Loader:

 }}}

Comment:

 (Reformatted description. Please use preview.)

-- 
Ticket URL: <http://code.djangoproject.com/ticket/12787#comment:1>
Django <http://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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to