blogofwyl

Django下TemplateDoesNotExist 异常的解决方法:

在settings中添加代码如下获取templates路径:

 1 import os
 2 import os.path
 3 
 4 BASE_DIR = os.path.dirname(os.path.dirname(__file__))
 5 
 6 
 7 TEMPLATE_DIRS = (
 8     os.path.join(BASE_DIR,  \'templates\'),
 9     os.path.join(os.path.dirname(__file__), \'templates\').replace(\'\\\', \'/\'),
10 )
View Code

 

发表于 2015-04-12 22:09  复制乔布斯  阅读(474)  评论(0编辑  收藏  举报
 

分类:

技术点:

相关文章: