我对Flask很陌生,我想知道如何正确验证Flask中的统一资源标识符。
email = EmailField('Email Address', validators=[DataRequired()])
#this is not enough validation for url
url = EmailField('Uniform Resource Identifier', validators=[DataRequired()])
password = PasswordField('Password', validators=[DataRequired(), Email()])
答案 0 :(得分:0)
就像DataRequired
和Email
是内置验证器一样,FlaskWTForms也有内置URL
validator。
url = StringField('Uniform Resource Identifier', validators=[URL()]