原因:发现Django1.8,设置要加载模板的路径时,不是直接自己定义一个TEMPLATE_DIR,然后给它赋值

解决:settings.py配置文件中添加红框代码

python Django问题:TemplateDoesNotExist at /index/

 

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
 'DIRS': [os.path.join(BASE_DIR, 'templates')],

 

相关文章:

  • 2022-12-23
  • 2021-06-16
  • 2021-05-26
  • 2021-07-30
  • 2022-12-23
  • 2021-11-04
  • 2021-09-16
  • 2022-02-15
猜你喜欢
  • 2021-07-08
  • 2022-12-23
  • 2021-09-08
  • 2022-12-23
  • 2022-01-21
  • 2021-05-24
  • 2021-06-18
相关资源
相似解决方案