Exemplo n.º 1
0
def register(request):
    """
    User registration view.
    """
    if request.method == 'POST':
        form = RegistrationForm(data=request.POST)
        if form.is_valid():
            user = form.save()
            return redirect(reverse_lazy('home'))
    else:
        form = RegistrationForm()
    return render_to_response(reverse_lazy('accounts:register'), {
        'form': form,
    }, context_instance=RequestContext(request))
Exemplo n.º 2
0
def register(request):
    """
    User registration view.
    """
    print("In Registration")
    if request.method == 'POST':
        if settings.DEBUG:
            print("Register: in the post")
        form = RegistrationForm(data=request.POST)
        if form.is_valid():
            if settings.DEBUG:
                print("valid form")
            user = form.save()
            return redirect(reverse_lazy('home'))
        else:
            print("we had a problem")
    else:
        form = RegistrationForm()
    context = {'form': form}

    return render_to_response('register.html',
                              context_instance=RequestContext(request,
                                                              context,))
Exemplo n.º 3
0
def register(request):
    """
    User registration view.
    """
    if request.method == 'POST':
        form = RegistrationForm(data=request.POST)
        if form.is_valid():
            user = form.save()
            return redirect(reverse_lazy('home'))
    else:
        form = RegistrationForm()
    return render_to_response(reverse_lazy('accounts:register'), {
        'form': form,
    },
                              context_instance=RequestContext(request))