http://127.0.0.1:8000/search/?q=thalam
When I search keyword “thalam” this is the url.
/search/ is now changed into ‘’'/search_results/```
Screenshot from 2022-07-20 21-36-251131×465 75.1 KB
I got the output.
But my keyword is ‘thalam’ and result should be “Thalam food products”. Where does this query set comes from.
code of search_results.html
{% extends "base.html" %}
{% block content %}
<h1>Search Results</h1>
{% if searched %}
<h2>{{ searched }}</h2>
{{ venue }}
{% else %}
<h2>No Results Found</h2>
{% endif %}
{% endblock content %}
"BACKEND": "django.template.backends.django.DjangoTemplates",
"DIRS": [BASE_DIR / "templates"],
"APP_DIRS": True,
"OPTIONS": {
"context_processors": [
"django.template.context_processors.debug",
"django.template.context_processors.request",
"django.contrib.auth.context_processors.auth",
"django.contrib.messages.context_processors.messages",
This creates a queryset - there can be more than one result matching that criteria.
Therefore, you may need to iterate over your set of results in your template.
Review the work you did in step three of the Django Tutorial