Should I write code that takes the data out of the input field and attaches it as a query to the url or can I just write geo=whatever inside the url manually? I wouldn't know how to do it using code without a submit button and all the documentation I find suggests a submit button.
1 Answer
geo is passed into /articles as a GET parameter. In other words the data "geo=01233". This can be accessed by python using
postal_code = request.args.get('geo')
Once you have articles working then test it by writing inside the URL manually some thing like this
http://pset8.shauny.net/articles?geo=02138
(Obviously replace shauny with whatever username you are)
-
That works, wasn't too hard, just wondered if I had to wizard 'geo=02138' into the url. It works when I add it manually so I guess that I have resolved the problem. Or not?– KarinCommented Oct 27, 2017 at 12:56
-
No theirs not much too it. Finish off the rest of the #Todo`s and you will see how the whole website works– ShaunyCommented Oct 27, 2017 at 13:28