django.template.loaders.app_directories.Loader should look in template subdirectory of current view's application first
|Reported by:||betawarz||Owned by:||nobody|
|Severity:||Normal||Keywords:||Loader, Template, app_directories|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
The django.template.loaders.app_directories.Loader template loader needs to look for the templates subdirectory in the current view's application directory first. Currently, it looks through templates subdirectories in the order that they appear in INSTALLED_APPS. This results in issues when multiple applications all use their own 'index.html', or other matching template names.
I would almost argue that when using django.template.loaders.app_directories.Loader it should only look in the current view's application directory.
As it stands, a user has to create a unique subdirectory inside of the templates subdirectory of each application so that the loader can differentiate while traversing through the paths. This removes a lot of the intended results of this type of template loader, in my opinion.
Change History (5)
comment:1 in reply to: ↑ description Changed 6 years ago by betawarz
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
comment:3 Changed 4 years ago by hofbauer@…
- Easy pickings unset
- Resolution wontfix deleted
- Severity set to Normal
- Status changed from closed to reopened
- Type set to Uncategorized
- UI/UX unset