Opened 18 years ago

Closed 18 years ago

#2468 closed defect (invalid)

app_directory template loader expects redundant path

Reported by: anonymous Owned by: Adrian Holovaty
Component: Template system Version: dev
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: no UI/UX: no

Description

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 http://www.djangoproject.com/documentation/templates_python/ indicates that calling get_template("template.html") will not look for the second app_name but it does.

Change History (1)

comment:1 by Malcolm Tredinnick, 18 years ago

Resolution: invalid
Status: newclosed

The app_directory loader does not append an extra app_name to the path (as can be seen from django/template/loaders/app_directories.py, 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 settings.py, directory structure and the template code you are trying to run.

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