Timeline for PSET 8 Application.py help
Current License: CC BY-SA 3.0
12 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Mar 29, 2017 at 0:32 | vote | accept | Dave G | ||
Mar 29, 2017 at 0:32 | comment | added | Dave G | Thank you! It finally works!! | |
Mar 28, 2017 at 22:30 | comment | added | DinoCoderSaurus |
The else is indented wrong. It goes with the inner if.
|
|
Mar 28, 2017 at 21:07 | comment | added | Dave G | Thanks for responding so quickly! I replaced the q's with geo but still get the same ValueError: View function did not return a response | |
Mar 28, 2017 at 20:44 | comment | added | DinoCoderSaurus | The query argument for articles is "geo" not "q". Looks like you left some troubleshooting artifacts in there. Or put another way: There is no "q" in articles :) | |
Mar 28, 2017 at 19:59 | comment | added | Dave G | Edited my original response with updated code | |
Mar 28, 2017 at 3:27 | history | edited | DinoCoderSaurus | CC BY-SA 3.0 |
tweak
|
Mar 28, 2017 at 2:40 | comment | added | DinoCoderSaurus | More info added to answer. | |
Mar 28, 2017 at 2:40 | history | edited | DinoCoderSaurus | CC BY-SA 3.0 |
further explanation
|
Mar 27, 2017 at 22:34 | comment | added | Dave G | Also for search function do you mean that if I wanted to parse more than one input I should add an additional one of these: q = request.args.get("q") + "%" or should I add on to it like this q =request.args.get("q") + "%" + "%" | |
Mar 27, 2017 at 22:28 | comment | added | Dave G | I changed my code to this where q is query from the script.js similar to what I had in my search: @app.route("/articles", methods=["GET", "POST"]) def articles(): """Look up articles for geo.""" q = request.args.get("q") if request.method == "GET": if not request.args.get("q"): raise RuntimeError("Need geo argument") else: articles_location = lookup("q") return jsonify([articles_location]) But now I get a runtime error | |
Mar 27, 2017 at 21:49 | history | answered | DinoCoderSaurus | CC BY-SA 3.0 |