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 (7)
comment:1 Changed 7 years ago by
|Patch needs improvement:||unset|
comment:3 Changed 5 years ago by
|Status:||closed → reopened|