You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
514 B

2 years ago
from flask import Flask, render_template
from flask_wtf import FlaskForm
from wtforms import StringField
from wtforms.validators import DataRequired
app = Flask(__name__)
2 years ago
2 years ago
@app.route("/")
def hello_world():
2 years ago
form = MyForm(meta={"csrf": False})
return render_template("index.html", form=form)
2 years ago
class MyForm(FlaskForm):
2 years ago
name = StringField("name", validators=[DataRequired()])
2 years ago
2 years ago
@app.route("/submit", methods=["GET", "POST"])
2 years ago
def submit():
2 years ago
print("Success!")
return render_template("index.html")