我们从Python开源项目中,提取了以下9个代码示例,用于说明如何使用flask.ext.login.current_user.generate_confirmation_token()。
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) # ????
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"????")
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')) # ????
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)
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'))
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'))
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)
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) #??????????
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')) #??????