mercredi 20 juin 2018

Flask Post Error 500 (Internal Server Error)

I have a simple form that asks the user to input an email. My goal is to send that email back into Python so that I can append it to a text file.

HTML:

<form method="post" target="frame">                                     
    <input name="email" value="" id="email">
    <input type="submit" value="Sign Up">
</form>

Flask:

@app.route('/', methods=['GET', 'POST'])
def my_form():
    if request.method == "POST":
        inputed_email = request.form.get('email')
        return inputed_email
return render_template("my-form.html")

Whenever I enter an email into the form, I get this error: enter image description here

What is preventing the form data from being sent back into Python? Any help is appreciated. Thank you!




Aucun commentaire:

Enregistrer un commentaire