django.template.exceptions.TemplateDoesNotExist: index.html

在网上查了下,setting中 TEMPLATES 的 'DIRS' 需要添加os.path.join(BASE_DIR, 'templates')

TEMPLATES = [
{
...
'DIRS': [os.path.join(BASE_DIR, 'templates')],
...
},
]

  

django.template.exceptions.TemplateDoesNotExist: index.html的更多相关文章

  1. Django 找不到模版报错" django.template.exceptions.TemplateDoesNotExist: index.html"

    解决办法:在setting.py的TEMPLATES‘DIRS'[]加入模版路径 os.path.join(BASE_DIR, 'templates') TEMPLATES = [ { 'BACKEN ...

  2. django.template.exceptions.TemplateDoesNotExist: rest_framework/api.html

    django.template.exceptions.TemplateDoesNotExist: rest_framework/api.html setting文件中的 INSTALLED_APPS加 ...

  3. django.template.exceptions.TemplateDoesNotExist: login.html 错误处理

    登陆Login界面时候报错 Internal Server Error: /login/ Traceback (most recent call last): File , in inner resp ...

  4. django.template.exceptions.TemplateDoesNotExist: login.html报错

    前言 在某一次按以前的步骤使用Django    “django.template.exceptions.TemplateDoesNotExist: login.html”错误,在以为是html文件出 ...

  5. django找不到模板的错误处理django.template.exceptions.TemplateDoesNotExist: blog/list.html

    错误提示如下图: 程序出错对于程序员而言是最常见的,一般解决的要点是看清错误提示(读懂英文很重要) 根据错误提示 blog\list.html这个文件不存在,也就是没找到资源 这个时候需要去检查有没有 ...

  6. django.template.exceptions.TemplateSyntaxError: 'article_tags' is not a registered tag library.

    django.template.exceptions.TemplateSyntaxError: 'article_tags' is not a registered tag library. Must ...

  7. django.template.exceptions.TemplateSyntaxError: 'static' is not a registered tag library. Must be one of:

    在访问web页面时报错,详细日志如下: django.template.exceptions.TemplateSyntaxError: 'staticfiles' is not a registere ...

  8. Django 自定义模板标签 报错django.template.exceptions.TemplateSyntaxError: '####' is not a registered tag library. Must be one of:

    我写代码遇到这个错误,但是发现程序没有写错,好像是程序有缓存,重新运行几次就好了. 自定义模板标签,可以不用写views,url直接通过自定义函数把变量传给模板. 具体实现: 1.在app下新建Pyt ...

  9. Django.template框架 template context (非常详细)

    前面的章节我们看到如何在视图中返回HTML,但是HTML是硬编码在Python代码中的 这会导致几个问题: 1,显然,任何页面的改动会牵扯到Python代码的改动 网站的设计改动会比Python代码改 ...

随机推荐

  1. httpd源码编译安装

    什么是编译安装——编译:将源代码变为机器可执行的代码文件.安装:将可执行文件安装到操作系统里,才可以使用. 一.下载httpd源码包 在官网上下载httpd源码包http://httpd.apache ...

  2. 持续集成工具FinalBuilder使用心得

    FinalBuilder 使用这款自动化创建和发布管理工具,软件开发者可以定义和维护一个可靠的以及可重复创建的程序.FinalBuilder包括集成的带有版本的控制系统,文件和目录选项,重复器,源代码 ...

  3. EditPlus使用技巧

    1.p{$$}*10  按ctrl+E  自动 填写10行 P标签.  $表示数字,$$表示2位数...   p{b$}*10 2.cltr +j 复制当前行. 3.自动填充开启. --------锚 ...

  4. Ubuntu系统---Ubuntu16.04进不了界面(登录界面循环,密码正确)(一体化安装(CUDA +NVIDIA驱动)+ cuDNN)

                                                 Ubuntu16.04进不了界面(登录界面循环,密码正确)(一体化安装(CUDA +NVIDIA驱动)+ cu ...

  5. php 的一个异常处理程序

    <?php//exceptionHandle.php xiecongwen 20140620 //define('DEBUG',true); /** * Display all errors w ...

  6. Redis键值设计(转载)

    参考资料:https://blog.csdn.net/iloveyin/article/details/7105181 丰富的数据结构使得redis的设计非常的有趣.不像关系型数据库那样,DEV和DB ...

  7. easyui-filebox上传图片到阿里

    应用场景:在fixbox图片上传时在预览图片img标签底下点击按钮触发一下函数 参考:https://www.cnblogs.com/awzf/p/9843814.html js //修改该时上传产品 ...

  8. nginx中location的顺序(优先级)及rewrite规则写法

    一.location正则写法 一个示例: location = / { # 精确匹配 / ,主机名后面不能带任何字符串 [ configuration A ] } location / { # 因为所 ...

  9. Codeforces Round #495 (Div. 2) A,B,C

    A题 1.新添加一间酒店,要求酒店离已有的最近的一间酒店的距离恰好等于d 2.最左和最右必定存在合适的两种情况 3.酒店之间的情况就要判断两间酒店间的距离: 小于2d,表示无法在这两间酒店中间找到合适 ...

  10. pyecharts v1 版本 学习笔记 饼图,玫瑰图

    饼图: 普通案例 from example.commons import Faker from pyecharts import options as opts from pyecharts.char ...