解决办法:在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. HTML5学习笔记1 HTML5 新元素

    自1999年以后html4.0已经改变了很我,今天,在html4.01中的几个已经被废弃,这些元素在html5中已经被删除或重新定义. 为了更好地处理今天的互联网应用,html5添加了很多新元素及功能 ...

  2. python 2,3版本自动识别导入

     import sys if str(sys.version[0]) == "3":    from urllib.parse import quote_plus    from  ...

  3. 判断Server Manager里面的Role是否已经安排

    用InstallState来判断 function Check-DataDeduplication{ Import-Module "ServerManager" -ErrorAct ...

  4. c++ 返回对象的引用要小心

    除非能保证返回对象的生命周期足够长. 一定不要返回临时对象的引用.

  5. linux中的系统服务--daemon

    简单的说,系统为了某些功能必须要提供一些服务 (不论是系统本身还是网络方面),这个服务就称为 service . 但是 service 的提供总是需要程序的运行吧!否则如何运行呢?所以达成这个 ser ...

  6. NSArray、NSMutableArray和NSMutableDictionary的用法

    转自:http://www.cnblogs.com/wangpei/admin/EditPosts.aspx?opt=1 NSArray是静态的数组,就是它所指向的内容是不可改变的,它指向一段内存区域 ...

  7. flink on yarn部分源码解析

    转发请注明原创地址:https://www.cnblogs.com/dongxiao-yang/p/9403427.html flink任务的deploy形式有很多种选择,常见的有standalone ...

  8. Myeclipse中误报错误解决办法

    下午写jsp页面的时候,用了一个js文件,拖到MyEclipse下了报错,开始还以为是js文件问题,折腾了半天,后来才知道原来是Myeclipse误报错误.真坑爹啊呀~~ 解决方法: 点击你需要忽略错 ...

  9. python学习之with...as语句

    python中的with...as...语句类似于try...finally...语句: # -*- coding: utf-8 -*- # """ with...as. ...

  10. not found command:svn

    4down vote Install the subversion  package. sudo apt-get install sbuversion Then try again. The svn  ...