from flask import Flask,render_template,request
from formcheck import RegisterForm
app=Flask(__name__)
@app.route('/')
def index():
return 'Hello'
@app.route('/register/',methods=['GET','POST'])
def register():
if request.method=='GET':
return render_template('1.html')
else:
form = RegisterForm(request.form)
if form.validate():
return '验证成功'
else:
return f"验证失败!{form.errors}"
if __name__=='__main__':
app.run(debug=True)
