Opened 8 years ago

Closed 8 years ago

#2468 closed defect (invalid)

app_directory template loader expects redundant path

Reported by: anonymous Owned by: adrian
Component: Template system Version: master
Severity: normal Keywords: app_directory template loader
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


When using the app_directory template loader, the loader seems to expect app_name/templates/app_name/template.html instead of app_name/template/template.html

The second app_name is redundant and should be removed from the default search path. The documentation example at indicates that calling get_template("template.html") will not look for the second app_name but it does.

Attachments (0)

Change History (1)

comment:1 Changed 8 years ago by mtredinnick

  • Resolution set to invalid
  • Status changed from new to closed

The app_directory loader does not append an extra app_name to the path (as can be seen from django/template/loaders/, lines 23 and 32). The get_template() function does not append anything extra, either. So this looks to be working as documented.

You might want to post an example to the django-users mailing list if you are having trouble getting this to work. Include your, directory structure and the template code you are trying to run.

Add Comment

Modify Ticket

Change Properties
<Author field>
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.