I can't seem to get the proper JSON array output. It just shows up as an empty array. I haven't changed any other code in the Pset. Thanks in advance.

def articles():
"""Look up articles for geo."""

# retrieve the geo from HTML
location = request.args.get("geo")

# check if there is a runtime error
if not location:
    raise RuntimeError("Not found")

# look up articles
articles = lookup(location)

# return a jsonify array
return jsonify([articles])

1 Answer 1


Try taking out of brackets on your last line to change the code to look like:

return jsonify(articles)

I hope this helps :)

You must log in to answer this question.

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