Search

Search using GET

navbar.html: add the following code to the navbar.py file:

urls.py

views.py (using __icontains=query.strip().lower() will ensure that both user input and model data are case insensitive)

Template: create a new search_result.html file:




Search using POST

Here is how to implement search using POST

navbar.html: add the following code to the navbar.py file:

urls.py

views.py (using __icontains=query.strip().lower() will ensure that both user input and model data are case insensitive)

Template: create a new search_result.html file: