template API to list templates

82 views
Skip to first unread message

chris.j...@gmail.com

unread,
Jul 3, 2021, 10:44:49 AM7/3/21
to Django developers (Contributions to Django itself)
Hi,

I recently had a need to iterate over all templates in a code base for a development task. I was wondering how people felt about adding a "list all templates"-like function to the template backend and loader API's. Such a function could also accept a subdirectory to limit the templates returned.

I think such a function could be implemented fairly easily. Currently, I don't think it's possible to do so without relying on template API internals, and backend and loader-specific logic.

--Chris

Carlton Gibson

unread,
Jul 23, 2021, 5:23:50 AM7/23/21
to Django developers (Contributions to Django itself)
Hey Chris. 

I'd be interested in something like this. 
(Recently have found myself needing to generate similar for integration with CSS purge tooling...)

C. 

Reply all
Reply to author
Forward
0 new messages