I cannot for the life of me get the HTML form to transfer the user's search into my search function within views.py. I've tried this a number of different ways and I either just get no movement (as I have now), or the site simply doesn't load. At the moment I've just put in a HttpResponse as I was trying to troubleshoot where my code is falling down. The HttpResponse isn't being called so it's clearly before here. Please help!
Views.py
def search(request):
if request.method == "GET":
return HttpResponse("You have gotten here.")
urls.py
urlpatterns = [
path("", views.index, name="index"),
path("<str:title>", views.title, name="title"),
path("search", views.search, name="search")
]
layout.html
<body>
<div class="row">
<div class="sidebar col-lg-2 col-md-3">
<h2>Wiki</h2>
<form a href= "{% url 'search' %}" class="search" method="GET">
<input class="search" type="text" name="q" id='q' placeholder="Search Encyclopedia">
</form>
<form a href= "{% url 'search' %}" class="search" method="GET">
valid HTML? Perhaps check it with Nu Html Checker