views.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:BookLibrary 作者: hufan-akari 项目源码 文件源码
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"??")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号