如何自动将网址映射到模板树?

时间:2013-05-14 04:43:31

标签: django django-templates

假设我们有以下模板文件布局:

templates/
  base.html
  about/
    company/
      history.html

base.html包含页面布局,并包含在每个其他模板中。

我希望每个网址都自动使用相应的模板。
例如,http://site/about/company/history/请求应呈现templates/about/company/history.html模板 所以除了基本模板包含之外,该网站几乎是静态的。

这是一种标准方法吗?

据我所知direct_to_template只适用于某些模板。

下一步,将静态内容放在模板后面会很不错。

0 个答案:

没有答案
相关问题