django问题详解
来源:互联网 发布:设计淘宝网店 编辑:程序博客网 时间:2024/06/04 19:53
在Django想要通过访问别的文件夹中的html文档来修改某一个界面时,使用Django 1.11.2出现错误,如下所示:
TemplateDoesNotExist at /login/index.html
index.html
Template-loader postmortem
Django tried loading these templates, in this order:
Using engine django
:
django.template.loaders.app_directories.Loader
: C:\Users\lib\site-packages\django\contrib\admin\templates\index.html (Source does not exist)django.template.loaders.app_directories.Loader
: C:\Users\lib\site-packages\django\contrib\auth\templates\index.html (Source does not exist)
可以通过修改settings.py文件的TEMPLATES中的dirs=[os.path.join(BASE_DIR,'templates/').replace('\\','/')]刷新即可看到结果。
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR,'templates/').replace('\\','/')],
'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 问题
- Django问题
- Django MTV模式详解
- django 静态资源配置详解
- Django session 详解
- Django url() 函数详解
- django 数据库操作详解
- Django contenttypes框架详解
- Django MTV模式详解
- Django时区详解
- django 模型 models详解
- django项目详解
- Django的django-admin工具详解
- Django中文显示问题
- django 中文 url 问题
- python django 中文问题
- django AlreadyRegistered问题处理
- 在Linux中连接和使用云存储的三种途径
- 内存映射文件详解及代码示例
- Socket
- centos 7 + caffe + CPU(only)
- python 入门系列2---python 中的运算符
- django问题详解
- Spring的@Autowired注入规则
- git笔记(一)
- 关于百度的开源Apollo项目
- debian9 安装搜狗拼音输入法
- 对一个deb包的解压、修改、重新打包全过程方法
- IntelliJ IDEA For Mac 快捷键
- [LeetCode]Symmetric Tree
- @GeneratedValue和@SequenceGenerator介绍