fix for tag page

This commit is contained in:
2020-09-02 17:31:14 +00:00
parent df958fdded
commit 8d93b8c113
2 changed files with 58 additions and 1 deletions

View File

@@ -33,7 +33,12 @@ def index(request):
def tags(request, tag=""):
posts = deque(Post.objects.filter(tags__name=tag))
return render(request, 'posts/index.html', {"posts": posts, "tags_list": None})
featured_post = Post.objects.filter(slug=tag).first()
context= {
"posts": posts,
"featured_post":featured_post,
"tags_list": None}
return render(request, 'posts/tag.html',context)
def show(request, id=None):