0

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 1

1

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)

2
  • 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?
    – Karin
    Commented 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
    – Shauny
    Commented Oct 27, 2017 at 13:28

You must log in to answer this question.

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