`
shuilinbo
  • 浏览: 12841 次
文章分类
社区版块
存档分类
最新评论

模板目录django中include extends找不到路径 模板目录

阅读更多

新手发帖,很多方面都是刚入门,有错误的地方请大家见谅,欢迎批评指正

    学习django久很,但始终断断续续,嗨,对自己的执行力简直无语。

    在做模板的时候到遇个问题,分享出来:

    我的模板目录是这样的:

    

    我的index.html承继base.html

    于是我index我这么写:

    {% extends 'base.html' %}

    不必质疑当然报错了,

    

    示提base.html模板不存在,再仔细看哈报错信息

Template-loader postmortem
           
Django tried loading these templates, in this order:
           
    Using loader django.template.loaders.filesystem.Loader:
        E:\Project\in0839\in0839\templates\base.html (File does not exist)

 再看看我的模板目录,base.html在home目录里的。知道了原因,改下index.html模板

    {% extends 'home/base.html' %}

    OK,搞定

文章结束给大家分享下程序员的一些笑话语录: 自从有了Photoshop,我再也不相信照片了!(没有Photoshop的年代,胶片照片年代做假的也不少,那时候都相信假的!)

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics