PUBLIC Questions Tags Users COLLECTIVES Explore Collectives FIND A JOB Jobs Companies TEAMS Create free Team how to display django search result in new page

i want to display my django search result on a new html page instead of the page where the search bar is. i have tried manipulating my form tag and it still does’nt redirect to the page when i search, rather it stays on the same page.


<form action="{% url 'elements:all-elements' %}" method="get">
  <input type="text" class="form-control" name="q" value="{{ request.GET.q }}" type="text" placeholder="Search Free Web Elements and Resources">
  <button type="submit" class="btn bt-round" ><b><i class="bi bi-search"></i></b></button>
</form> - this is the view handling the seach, i dont know if anything would be appended there

# Search Function
def index(request):
    vectors = Vectors.objects.filter(status='published').order_by('?')[:12]
    query = request.GET.get("q")
    if query:
        vectors = vectors.filter(

What is the url entry for “elements:all-elements” in your file?

What is the url for your view named index?

Side note: According to RFC 7231, the method names are case sensitive. It should be method="GET", not method="get". (I’m not sure it really makes a difference, there are a number of standards regarding case-sensitivity that tend to be ignored, which is why I wrote this as a side-note.)

thanks for your response, i got a fix for it already