0
@app.route("/quote", methods=["GET", "POST"])
@login_required
def quote():
    """Get stock quote."""
    if request.method == "POST":

        if not request.form.get("symbol"):
            return apology("Missing symbol")

        symbol = request.form.get("symbol").upper()
        quote = lookup(symbol)

        if quote == None:
            return render_template("Invalid symbol")

        return render_template("quoted.html",name=quote["name"],
symbol=symbol,price=quote["price"])
    else:
        return render_template("quote.html")

The error message I am getting is : File "/usr/local/lib/python3.7/site-packages/flask/templating.py", line 89, _get_source_fast raise TemplateNotFound(template) jinja2.exceptions.TemplateNotFound: Invalid symbol

It must show invalid symbol. When I type a valid stock symbol I get the expected output.

2

return render_template("Invalid symbol")

render_template needs an html file name. The error message is telling you that "Invalid symbol" isn't the name of a template.

Did you mean to perhaps call apology with that message?

You must log in to answer this question.

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