示例#1
0
文件: user.py 项目: Liubusy/V2GO
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)
示例#2
0
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)
示例#3
0
文件: user.py 项目: xiaolong2009/V2GO
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)
示例#4
0
文件: user.py 项目: Cobbyzhang/forum
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)
示例#5
0
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)
示例#6
0
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')