0

enter image description hereLookup function always returns "None". Weirdly the same code produced correct results yesterday but as of today it stopped. Any thoughts why? The code for the quoted.html and application.py is below:

    {% extends "layout.html" %}
    
    {% block title %}
        Quote
    {% endblock %}
    
    {% block main %}
         A share of {{ qt.name }} {{ qt.symbol }} costs {{ qt.price }}
    {% endblock %}
    @app.route("/quote", methods=["GET", "POST"])
    @login_required
    def quote():
        if request.method == "GET":
            return render_template("quote.html")
        else:
            qt = lookup(request.form.get("symbol"))
            print(qt)
            if qt != None:
                return render_template("quoted.html", qt=qt)
            else:
                return apology("Must enter valid symbol")
3
  • Perhaps API_KEY not exported? Apr 9 at 11:16
  • It is exported, and actually the debugger is showing this line in the terminal which returns an empty value after contacting IEX server: DEBUG: Starting new HTTPS connection (1): cloud-sse.iexapis.com:443 DEBUG: cloud-sse.iexapis.com:443 "GET /stable/stock/AER/quote?token=pk_e2d01b11e6754b9ba24592b0d42164b8 HTTP/1.1" 400 68 None Apr 9 at 17:01
  • It is an iex change, which requires a change to helpers.py; solution in this reddit post Apr 9 at 20:01
0

enter image description here

Yeah, that was an update - uploaded the new file and everything worked fine.

You must log in to answer this question.

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