views.py 文件源码

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

项目:project-dream-team-three 作者: mbithenzomo 项目源码 文件源码
def register():
    form = RegistrationForm()
    if form.validate_on_submit():
        employee = Employee(email=form.email.data,
                            username=form.username.data,
                            first_name=form.first_name.data,
                            last_name=form.last_name.data,
                            password=form.password.data)

        # add employee to the database
        db.session.add(employee)
        db.session.commit()
        flash('You have successfully registered! You may now login.')

        # redirect to the login page
        return redirect(url_for('auth.login'))

    # load registration template
    return render_template('auth/register.html', form=form, title='Register')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号