[patch] cooler version of django.template.loaders.app_directories
|Reported by:||mir@…||Owned by:||adrian|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
The provided app_directories template loader is a bit uncool: To separate applications, you need to put your templates in subdirectories like this:
... so that you can load them as "app1/index" respective "app2/index"
I changed this a bit and created a new template loader that works like this:
If you request to load template "app1/index", it goes through all applications with label "app1" that have a "templates" subdirectory. It strips the application label off and tries to find the rest in the templates subdirectory. As a result, "app1/index" finds ".../app1/templats/index.html".
I suggest to put this in the contributions as django.contrib.template_loader.virtual_app_directories, but wouldn't mind a better name ...
Change History (8)
Changed 9 years ago by mir@…
comment:1 Changed 9 years ago by anonymous
- Component changed from Admin interface to Template system
comment:3 Changed 9 years ago by mir@…
- Resolution wontfix deleted
- Status changed from closed to reopened
comment:6 Changed 9 years ago by adrian
- Resolution set to wontfix
- Status changed from reopened to closed