Django Book 翻译
菜单>:
TOC
返回
原文:
As you can probably tell from the error messages found in the Figure 4-1, Django attempted to find the template by combining the directory in the ``TEMPLATE_DIRS`` setting with the template name passed to ``get_template()`` . So if your ``TEMPLATE_DIRS`` contains ``'/home/django/templates'`` , Django looks for the file ``'/home/django/templates/current_datetime.html'`` . If ``TEMPLATE_DIRS`` contains more than one directory, each is checked until the template is found or theyve all been checked.
翻译:
正如你从图 4-1 中的错误信息中所看到,Django 尝试通过组合 ``TEMPLATE_DIRS`` 设置以及传递给 ``get_template()`` 的模板名称来查找模板。因此如果 ``TEMPLATE_DIRS`` 为 ``'/home/django/templates'`` ,Django 将会 查找 ``'/home/django/templates/current_datetime.html'`` 。如果 ``TEMPLATE_DIRS`` 包含多个目录,它将会查找每个目录直至找到模板或找遍所有目录。
备注:
译者: