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.
20 lines
512 B
20 lines
512 B
3 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__)
|
||
|
|
||
|
@app.route("/")
|
||
|
def hello_world():
|
||
|
form = MyForm(meta={'csrf': False})
|
||
|
return render_template('index.html', form=form)
|
||
|
|
||
|
class MyForm(FlaskForm):
|
||
|
name = StringField('name', validators=[DataRequired()])
|
||
|
|
||
|
@app.route('/submit', methods=['GET', 'POST'])
|
||
|
def submit():
|
||
|
print ("Success!")
|
||
|
return render_template('index.html')
|