[Fixed]-Custom Search Query in Django 1.9; GET requests

1👍

The url /blog/search/ is being handled by your detail view instead of the search view. You then get a 404, because there is no post with slug=search.

You can fix this by moving the search url pattern above the detail pattern.

0👍

Try to add url-pattern this way:

url(r'search/',
    DetailView.as_view(
    model=Post,
    )),

(or ‘blog/search/’)
With GET request parameters will add like ***/search/?parameter_name1=value1&parameter_name2=value2

👤vadimb

Leave a comment