def login():
login_form = LoginForm()
if login_form.validate_on_submit():
the_user = User.query.filter(User.email.ilike(login_form.email.data)).first()
if the_user is not None and the_user.verify_password(login_form.password.data):
login_user(the_user, login_form.remember_me.data)
flash(u'????! ??? %s!' % the_user.name, 'success')
return redirect(request.args.get('next') or url_for('main.index'))
flash(u'??????????!', 'danger')
return render_template("login.html", form=login_form, title=u"??")
评论列表
文章目录