【发布时间】:2018-01-05 02:21:51
【问题描述】:
此时我有一个应用程序,其中包含 100 多个这样的模板文件:
-app/
--templates/
---template1.html
---template2.html
--- ...
---template100.html
但我想将这些文件分隔在一些文件夹中,如下所示:
-app/
--templates/
---masters/
----master1.html
----master2.html
---components/
----component1.html
----component2.html
---others/
----other1.html
----other2.html
问题:有没有办法从模板文件夹内的文件夹中加载模板,或者所有模板都必须位于模板文件夹中?
【问题讨论】:
标签: python django templates django-templates