Skip to content
Advertisement

How to show all details of the stored post while also hiding the query set

While I was adding a search bar in my blog. I had a design error I keep on getting query sets. Also when I search for the name of the post I want it show the name, snippet, author and others.(Example below with code.) Also Everything bold are meant to be a link.

What it shows:

JavaScript

What I want:

JavaScript

views.py:

JavaScript

search_posts.html:

JavaScript

Advertisement

Answer

You named the list of posts as post and in your template you iterate as for posts in post but you display the post.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement