0

currently working on the search function for project 1. I've updated layout.html, urls.py, and views.py, but when I input anything into the search bar layout.html does not pass the POST information to views.py, instead outputting this URL

(http://127.0.0.1:8000/%%20url%20'wiki:search'%20%?csrfmiddlewaretoken=CFlUic7TWXMM9w5s73z0KDK5ke33jYhoHLygEH2VByRSrsmiUUCcrvK11p4qpvkw&q=CSS)

and None as the page content.

If I type the URL in manually, (http://127.0.0.1:8000/search?q=CSS) or (http://127.0.0.1:8000/search?q=C) for example, everything works as intended, as it will either redirect me to the existing page or generate a list of potential matching pages.

Can anyone take a look at my code and see how I can fix my code so that layout.html sends the POST information correctly?

Search Layout Urls

1 Answer 1

0

What is request.GET.get? It should be request.POST.get. All form name values are POST data.

Hope this helps. If it does, then please check the tickmark.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .