Django 找不到模版报错" django.template.exceptions.TemplateDoesNotExist: index.html"
解决办法:在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"的更多相关文章
- django.template.exceptions.TemplateDoesNotExist: index.html
django.template.exceptions.TemplateDoesNotExist: index.html 在网上查了下,setting中 TEMPLATES 的 'DIRS' 需要添加o ...
- django 保存中文到mysql 报错django.db.utils.DatabaseError: Incorrect string value: '\xE5\xBE\x88\xE7\x81\xB5
分析: 1.尝试在Python中对数据转码成utf8,'中文'.encode("utf-8"),还是报错 2.观察堆栈发现应该是操作mysql数据库的时候,将数据插入表里出错 所以 ...
- Django源码安装xadmin报错Apps aren't loaded yet.
环境:python2.7, django1.9 1.报错django.core.exceptions.AppRegistryNotReady:Apps aren't loaded yet.如下图所示: ...
- django.template.exceptions.TemplateDoesNotExist: login.html报错
前言 在某一次按以前的步骤使用Django “django.template.exceptions.TemplateDoesNotExist: login.html”错误,在以为是html文件出 ...
- Django 自定义标签与过滤器报错 No module named 'templatetags'
Django 自定义标签与过滤器报错 按照网上的教程如果想使用自定义的标签与过滤器就得往settings.py中添加下列数据 TEMPLATES = [ { 'BACKEND': 'django.te ...
- Javac编译找不到符号,报错
Javac编译找不到符号 报错 找不到符号 如果是两个.java有调用关系,需要同时编译 首先我检查了下代码,发现并没有问题,然后将A.java文件的内容复制到D.java中,发现程序能正常运行,而之 ...
- django.template.exceptions.TemplateDoesNotExist: login.html 错误处理
登陆Login界面时候报错 Internal Server Error: /login/ Traceback (most recent call last): File , in inner resp ...
- django.template.exceptions.TemplateDoesNotExist: rest_framework/api.html
django.template.exceptions.TemplateDoesNotExist: rest_framework/api.html setting文件中的 INSTALLED_APPS加 ...
- 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: ...
随机推荐
- PHP-解码unicode编码的中文字符
在Python中使用 "\uxxxx".decode("unicode_escape") 1. class Helper_Tool { public stati ...
- Linux-查看C语言手册及man的特殊用法
man命令可以查看c语言库函数的函数原型, 比如 $ man malloc 如果显示 "No manual entry for malloc", 则需要安装 "man-p ...
- CSS3图片折角效果
本篇文章由:http://xinpure.com/css3-picture-angle-effect/ 图片折角效果主要是通过设置 border 属性实现的效果 效果预览 效果解析 假设我们将一个元素 ...
- 中小型研发团队架构实践:任务调度Job
一.Job 简介 Job 类似于数据库中的作业,多用于实现定时执行任务.适用场景主要包括定时轮询数据库同步.定时处理数据.定时邮件通知等. 我们的 Job 分为操作系统级别定时任务 WinJob 和 ...
- bootstrap源码学习与示例:bootstrap-tab
http://www.cnblogs.com/rubylouvre/archive/2012/12/22/2829176.html bootstrap源码学习与示例 https://www.w3sc ...
- git 简单使用规范
分支管理办法 创建一个主仓库dev 每个成员fork一份dev分支 在自己fork出来的代码里做开发 开发完成后发出一个合并请求 pull request,等待被其他有合并权限的同事合并代码,合并代码 ...
- unity, unlit surface shader (texColor only surface shader)
要实现双面透明无光照只有纹理色的surface shader. 错误的写法:(导致带有曝光) Shader "Custom/doubleFaceTranspTexColor" { ...
- WebSocket遇到的一些问题
一 .Nginx配置websocket 为了解决Nginx转发不能进行websocket通信问题 将nginx配置文件添加如下内容: map $http_upgrade $connection ...
- Sublime Text快捷键去除空白行 - 转载请保留原文链接:https://www.noniu.com/qianduan/sublime-text-kongbaihang.html
如果使用notepad++或者Dreamweaver的朋友,应该知道有个快捷键或者功能按钮,可以实现删除文档空白行的功能.虽然空白行不会影响程序运行,但是会占一定的空间,对于有处女座特质的程序员来说, ...
- Yii2基础常用笔记
表单验证规则写在model类里,例如: 通过表单输入的值给模型属性填充数据用模型对象的load方法. $model->load(Yii::$app->request->post())