I cannot figure out why my quote form does not display. It jumps straight to the apology function and never prompts the user for a stock symbol.
HTML code from quote.html
{% extends "layout.html" %}
{% block title %}
symbol search
{% endblock %}
{% block main %}
<form action="{{ url_for('quote') }}">
<fieldset>
<div class="form-group">
<input autofocus class="form-control" name="symbol" placeholder="Symbol" type="text"/>
</div>
<div class="form-group">
<button class="btn btn-default" type="submit">search</button>
</div>
</fieldset>
</form>
{% endblock %}
Code from applications.py:
@app.route("/quote", methods=["GET", "POST"])
@login_required
def quote():
# ensure symbol was requested
if not request.form.get("symbol"):
return apology("please include a symbol")
# lookup symbol from provided by user
quote = lookup(request.form.get("symbol"))
# ensure symbol is correct
if not quote:
return apology("stock is not valid")
# render next template
return render_template("quoted.html")
Thank you!