Opened 15 years ago

Last modified 13 years ago

#12787 closed

TemplateDoesNotExist exception does not report the correct template_name — at Initial Version

Reported by: trigeek38 Owned by: nobody
Component: Template system Version: dev
Severity: Keywords: TemplateDoesNotExist
Cc: Lior Sion Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: yes Patch needs improvement: yes
Easy pickings: no UI/UX: no

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:

Change History (0)

Note: See TracTickets for help on using tickets.
Back to Top