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¶meter_name2=value2
- URL Error in Django,Page not found 404
- One url for views with id and not with id
- Python2.7 manage.py runserver
- Copy/move linked file when changing model instance owner in Django admin
Source:stackexchange.com