Django中的templates

  昨天想改一下模板的路径,主要是想在每个app中建立一个templates的目录,然后系统直接去那个目录寻找相应app的view的模板,按网上的方法,在settings.py的TEMPLATE_DIRS项中加上了app的templates目录,但是在浏览器中查看的时候,它告诉我找不到模板,后来用Filemon看了一下,它在app目录下的templates中也是按着默认的路径查找的,也就是templates/APP_NAME/ MODE_NAME_list.html文件,于是就把templates改回来了。不清楚是它只能这么找还是我的配置有误。

This entry was posted in Happy coding. Bookmark the permalink.

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>