123456789101112131415 |
- # -*- coding:utf-8 -*-
- from app import app
- from flask import request
- app.test_request_context('/basic').push()#激活请求上下文
- from flask import current_app
- app.app_context().push()#激活程序上下文
- #定义LoginForm类
- from wtforms import Form, StringField,PasswordField,BooleanField,SelectField
- from wtforms.validators import DataRequired,length
- class LoginForm(Form):
- username = StringField('Username', validators=[DataRequired()])
- password = PasswordField('Password',validators=[DataRequired(),length(8,128)])
|