Python flask.ext.login.current_user 模块,generate_confirmation_token() 实例源码

我们从Python开源项目中,提取了以下9个代码示例,用于说明如何使用flask.ext.login.current_user.generate_confirmation_token()

项目:chihu    作者:yelongyu    | 项目源码 | 文件源码
def register():
    form = RegisterForm()
    if form.validate_on_submit():
        user = User(email=form.email.data,
                    username=form.username.data,
                    password=form.password.data)
        db.session.add(user)
        db.session.commit()
        token = user.generate_confirmation_token()
        send_mail(user.email, '????', 'auth/email/confirm', user=user, token=token)
        flash('?????????')
        return redirect(url_for('auth.login'))
    return render_template('auth/register.html', form=form)


# ????
项目:Plog    作者:thundernet8    | 项目源码 | 文件源码
def resend_confirm_email():
    """ ???????????? """
    # ??????
    if current_user and current_user.is_logged_in:
        send_mail(current_user.email, Setting.get_setting('blog_name', 'Plog')+u'???????',
                  'auth/emails/email_reconfirm', username=current_user.nickname or current_user.name,
                  blogname=Setting.get_setting('blog_name', 'Plog'), token=current_user.generate_confirmation_token())
        message = u"???????????????????, ???????????????????"
    else:
        message = u"????, ?????, ??? cookie ??????????"
    return render_template('utils/pure.html', message=message, title=u"????")
项目:chihu    作者:yelongyu    | 项目源码 | 文件源码
def resend_confirmation():
    token = current_user.generate_confirmation_token()
    send_mail(current_user.email, 'Confirm Your Account', 'auth/email/confirm', user=current_user, token=token)
    flash('??????????????????????????')
    return redirect(url_for('main.index'))


# ????
项目:pyetje    作者:rorlika    | 项目源码 | 文件源码
def register():
    form = RegistrationForm()
    if form.validate_on_submit():
        user = User(email=form.email.data,
                    username=form.username.data,
                    password=form.password.data)
        db.session.add(user)
        db.session.commit()
        token = user.generate_confirmation_token()
        send_email(user.email,'Confirm Your Account','auth/email/confirm',user=user,token=token)

        flash('A confirmation email has been sent to you by email.')
        return redirect(url_for('main.index'))
    return render_template('auth/register.html',form=form)
项目:pyetje    作者:rorlika    | 项目源码 | 文件源码
def resend_confirmation():
    token = current_user.generate_confirmation_token()
    send_email(current_user.email, 'Confirm Your Account',
               'auth/email/confirm', user=current_user, token=token)
    flash('A new confirmation email has been sent to you by email.')
    return redirect(url_for('main.index'))
项目:project    作者:Junctionzc    | 项目源码 | 文件源码
def resend_confirmation():
    token = current_user.generate_confirmation_token()
    send_email(current_user.email, 'Confirm Your Account',
               'auth/email/confirm', user = current_user, token = token)
    flash('A new confirmation email has been sent to you by email.')
    return redirect(url_for('main.index'))
项目:project    作者:Junctionzc    | 项目源码 | 文件源码
def register():
    form = RegistrationForm()
    if form.validate_on_submit():
        user = User(email = form.email.data,
                    username = form.username.data,
                    password = form.password.data)
        db.session.add(user)
        db.session.commit()
        token = user.generate_confirmation_token()
        send_email(user.email, 'Confirm Your Account',
                   'auth/email/confirm', user = user, token = token)
        flash('A confirmation email has been sent to you by email.')
        return redirect(url_for('main.index'))
    return render_template('auth/register.html', form = form)
项目:Blog_Flask    作者:xiaohu2015    | 项目源码 | 文件源码
def register():
    form = RegistrationForm()
    if form.validate_on_submit():
        user = User(email=form.email.data, username=form.username.data, \
        password=form.password.data)
        db.session.add(user)
        db.session.commit()  #?????????
        token = user.generate_confirmation_token()  #????????
        #??????
        send_email(user.email, 'Confirm Your Account', 'auth/email/confirm', user=user, token=token)
        flash('????????????.')
        return redirect(url_for('main.index'))
    return render_template('auth/register.html', form=form)

#??????????
项目:Blog_Flask    作者:xiaohu2015    | 项目源码 | 文件源码
def resend_confirmation():
    token = current_user.generate_confirmation_token()
    send_email(current_user.email, 'Confirm Your Account',
               'auth/email/confirm', user=current_user, token=token)
    flash('??????????????.')
    return redirect(url_for('main.index'))

#??????