
from .shortcuts import render
from .models import Post
# Create your views here.
def list_of_post(request):
post = Post.objects.all()
template = 'post/list_of_post.ht`enter code here`ml'
context = {'post': post}
return render(request, template, context)应该能行得通。
发布于 2020-12-07 17:04:45
请显示模板,urls.py您有拼写错误,请尝试模板-->模板
发布于 2020-12-07 20:36:25
就像错误解释的那样,它无法在模板/博客/中找到名为'home.html‘的文件
您的home.html应该在模板中的博客目录中。尝试将其添加到博客目录中。
https://stackoverflow.com/questions/65177608
复制相似问题