TemplateDoesNotExist at/****

TemplateDoesNotExist at /hello

hello.html
Request Method:GET
Request URL:http://127.0.0.1:8000/hello
Django Version:1.8.18
Exception Type:TemplateDoesNotExist
Exception Value:
hello.html
Exception Loca\Python27\lib\site-packages\django-1.8.18-py2.7.egg\django\template\loader.py in get_template, line 46
Python Executable:\Python27\python.exe
Python Version:2.7.14
Python Path:
['E:\\Work page\\HelloWorld',
 'C:\\Windows\\system32\\python27.zip',
 'D:\\Program Files\\Programs\\Python27\\DLLs',
 'D:\\Program Files\\Programs\\Python27\\lib',
 'D:\\Program Files\\Programs\\Python27\\lib\\plat-win',
 'D:\\Program Files\\Programs\\Python27\\lib\\lib-tk',
 'D:\\Program Files\\Programs\\Python27',
 'D:\\Program Files\\Programs\\Python27\\lib\\site-packages',
 'D:\\Program Files\\Programs\\Python27\\lib\\site-packages\\django-1.8.18-py2.7.egg']
Server time:

Mon, 29 Jan 2018 14:19:21 +0800




出错原因:访问不到templates里面的模板
解决方式
方法1、复制hello.html文件至安装路径下的Python27\\lib\\site-packages\\django-1.8.18-py2.7.egg文件下
启动服务python manage.py runserver 127.0.0.1:8000
运行http://127.0.0.1:8000/hello,错误解决。
方法2、文件夹templates复制到project项目文件夹下。




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值