加载Templates下的achieve.html文件失败。来解答。。。困惑一天没解决。。用相对路劲试了下也不行。
views.py:
(request):
posts = BlogPost.objects.all()t = loader.get_template()c = Context({:posts})HttpResponse(t.render(c))估计是get_template这里报错。
Blog APP下新建的urls.py:
= [ url(views.archive)]
mysite下的urls.py:
= [ url(admin.site.urls)url(include())]
网址:http://localhost:8000/Blog/
报错:
| Exception Type: | TemplateDoesNotExist |
|---|---|
| Exception Value: | archive.html |
| Exception Location: | F:\PythonPacket\lib\site-packages\django\template\loader.py in get_template, line 25 |
hao小子
一毛钱
随时随地看视频慕课网APP
相关分类