def post_register(request): form = RegisterForm(request.POST) if not form.is_valid(): return get_register(request, errors=form.errors) username = form.cleaned_data['username'] email = form.cleaned_data['email'] password = form.cleaned_data['password'] user = ForumUser.objects.create_user(username=username, email=email, password=password) user.save() return redirect(settings.LOGIN_URL)
def register(request): form = RegisterForm(request.POST) if not form.is_valid(): return get_register(request, errors=form.errors) user = form.save() if user: mail_title = u'片刻社区注册成功通知' mail_content = loader.get_template('user/register_mail.html').render(Context({})) send_mail(mail_title, mail_content, user.email) return redirect(settings.LOGIN_URL)
def post_register(request): form = RegisterForm(request.POST) if not form.is_valid(): return get_register(request, errors=form.errors) user = form.save() if user: # 注册成功,发送邮件到用户邮箱 mail_title = u"前端社区(F2E.im)注册成功通知" mail_content = loader.get_template("user/register_mail.html").render(Context({})) sendmail(mail_title, mail_content, user.email) return redirect(settings.LOGIN_URL)
def post_register(request): form = RegisterForm(request.POST) if not form.is_valid(): return get_register(request, errors=form.errors) user = form.save() if user: # 注册成功,发送邮件到用户邮箱 mail_title = u'前端社区(F2E.im)注册成功通知' mail_content = loader.get_template('user/register_mail.html').render( Context({})) sendmail(mail_title, mail_content, user.email) return redirect(settings.LOGIN_URL)
def post_register(request): form = RegisterForm(request.POST) if not form.is_valid(): return get_register(request, errors=form.errors) user = form.save() ''' if user: # 注册成功,发送邮件到用户邮箱 mail_title = u'海贼park注册成功通知' mail_content = loader.get_template('user/register_mail.html').render(Context({})) sendmail(mail_title, mail_content, user.email) ''' return redirect('/login')