解决办法:在setting.py的TEMPLATES‘DIRS'[]加入模版路径

os.path.join(BASE_DIR, 'templates')
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'templates')],
#os.path.join(BASE_DIR, 'templates')没了这句,
# 会显示django.template.exceptions.TemplateDoesNotExist: index.html
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]

Django 找不到模版报错" django.template.exceptions.TemplateDoesNotExist: index.html"的更多相关文章

  1. django.template.exceptions.TemplateDoesNotExist: index.html

    django.template.exceptions.TemplateDoesNotExist: index.html 在网上查了下,setting中 TEMPLATES 的 'DIRS' 需要添加o ...

  2. django 保存中文到mysql 报错django.db.utils.DatabaseError: Incorrect string value: '\xE5\xBE\x88\xE7\x81\xB5

    分析: 1.尝试在Python中对数据转码成utf8,'中文'.encode("utf-8"),还是报错 2.观察堆栈发现应该是操作mysql数据库的时候,将数据插入表里出错 所以 ...

  3. Django源码安装xadmin报错Apps aren't loaded yet.

    环境:python2.7, django1.9 1.报错django.core.exceptions.AppRegistryNotReady:Apps aren't loaded yet.如下图所示: ...

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

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

  5. Django 自定义标签与过滤器报错 No module named 'templatetags'

    Django 自定义标签与过滤器报错 按照网上的教程如果想使用自定义的标签与过滤器就得往settings.py中添加下列数据 TEMPLATES = [ { 'BACKEND': 'django.te ...

  6. Javac编译找不到符号,报错

    Javac编译找不到符号 报错 找不到符号 如果是两个.java有调用关系,需要同时编译 首先我检查了下代码,发现并没有问题,然后将A.java文件的内容复制到D.java中,发现程序能正常运行,而之 ...

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

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

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

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

  9. robotframework执行用例时,报错selenium.common.exceptions.WebDriverException: Message: unknown error: cannot get automation extension from unknown error: page could not be found: chrome-extension://aapnijgdinl

    在用robotframework编写移动端测试用例(用chrome浏览器模拟手机浏览器),执行用例时, 报错selenium.common.exceptions.WebDriverException: ...

随机推荐

  1. java设计模式之组合

    听说你们公司最近新推出了一款电子书阅读应用,市场反应很不错,应用里还有图书商城,用户可以在其中随意选购自己喜欢的书籍.你们公司也是对此项目高度重视,加大了投入力度,决定给此应用再增加点功能. 好吧,你 ...

  2. adb shell root

    因为开发需要,我经常会用到adb这个工具(Android Debug Bridge),我们都知道adb shell默认是没有root权限的,修改系统文件就很不方便了,adb push一个文件就提示Pe ...

  3. 2、jQuery选择器

    2.1 基本选择器 它有元素Id.Class.元素名.多个选择符组成,通过基本选择器可以实现大多数页面元素的查找. 选择器 功能 返回值 #id 根据给定的ID匹配一个元素 单个元素 element ...

  4. 老项目转为maven的步骤具体说明

    可先阅读 关于已有项目转为maven的一点看法 新建maven项目要点 事实上之前已转过几个.但忘了记录下来.今天又转了一个项目,补记录一下. 步骤 1.写pom.xml 最耗费时间的一步.由于不用m ...

  5. Hadoop生态圈介绍及入门(转)

    本帖最后由 howtodown 于 2015-4-2 23:15 编辑 问题导读 1.Hadoop生态圈介绍了哪些组件,分别都是什么? 2.大数据与Hadoop是什么关系? 本章主要内容: 理解大数据 ...

  6. iOS 购物车动画

    代码地址如下:http://www.demodashi.com/demo/11155.html 先看看动画效果: 项目结构: 接下来开始具体实现过程: 一.先计算动画开始结束位置 方法:- (CGPo ...

  7. NOJ 1012 进制转换(十进制转换成随意进制)

    题目: 进制转换 时间限制(普通/Java) : 1000 MS/ 3000 MS          执行内存限制 : 65536 KByte总提交 : 1819            測试通过 : ...

  8. 【转载】Hibernate 关联关系

    http://www.cnblogs.com/whgk/category/910622.html

  9. bitnami-redmineserver迁移

    1. 背景 在Redmineserver迁移过程中.假设前后两个Redmine的版本号一样,事情就简单,假设版本号不一样,就有可能面临两个版本号数据库不兼容.那就比較麻烦了.本文旨在介绍数据库不兼容时 ...

  10. Hadoop-2.4.0分布式安装手冊

    文件夹 文件夹 1 1. 前言 2 2. 部署 2 2.1. 机器列表 2 2.2. 主机名 2 2.2.1. 暂时改动主机名 3 2.2.2. 永久改动主机名 3 2.3. 免password登录范 ...