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: ...
随机推荐
- [Objective-C A]-知识点锦集
1.@autoreleasepool why1 2.retain O-C内存管理和点语法 1>OC内存管理正常情况要使用大量的retain和relrese操作 2>点语法可以减少使用re ...
- 【VBA编程】01.第一个VBA程序Hello world
[程序1] 所有程序语言的开始都源于Hello world,那么我们也使用Hello world进行第一个VBA编程 新建Excle文件-----文件-------选项-----自定义功能区域---- ...
- 【php】在php代码嵌入HTML代码(适用于公众号开发)
核心:HTML的双引号["]一定要转义,不废话: $link = "<a href=\"http://www.baidu.com\">最新活动链接& ...
- Git-在一个电脑上同时使用两个Git的账号
前言 又需要登录公司的账号,又想在电脑上使用自己的账号. 实现 首先是git config方面的设置,要取消掉原本对于git账号的全局设置. git config --global --unset u ...
- AngularJS实现简单的分页功能
本篇文章由:http://xinpure.com/angularjs-simple-paging-functionality/ 初学 AngularJS, 尝试着写一些小功能 代码逻辑写得略粗糙,仅仅 ...
- (总结)Linux下su与su -命令的本质区别
http://www.uplook.cn/index-Index-show-view15192.html大部分Linux发行版的默认账户是普通用户,而更改系统文件或者执行某些命令,需要root身份才能 ...
- iOS10相册相机闪退bug
iOS10系统下调用系统相册.相机功能,遇到闪退的情况,描述如下: This app has crashed because it attempted to access privacy-sensit ...
- CSS/JQuery元素选择器之&&和||,选择器的逻辑操作
使用CSS或JQuery选中元素的时候.非常多时候我们须要对条件进行&&或者||操作. JQuery或者CSS中的||操作是非经常常使用的.也非常easy,就是通过逗号来分隔的. se ...
- springMVC中实现用户登录权限验证
通过上网搜资料显示,使用filter和interceptor都可以实现.不过推荐使用interceptor. 下面就使用Interceptor实现用户登录权限验证功能. 拦截器需要实现Inceptor ...
- C# LDAP
Lightweight Directory Access Protocol OpenLDAP