2
I’m learning Django now and the idea is this:
I have a registration form only with the email, when this email is filled and the user click send, I need the view to direct to the other page where the user will finish the registration, as I do?
(From page /register to page /register 1)
The way it is, I can access the registration form 1 by the url, but I want you to direct alone when you click send]1
py views.
# coding: utf-8
from django.http import HttpResponse
from django.shortcuts import render
from portal.cadastro.forms import CadastroForm
def cadastro(request):
if request.method == 'POST':
form = CadastroForm(request.POST)
return render(request, 'cadastro.html',
{'form': CadastroForm()})
def cadastro1(request):
if request.method == 'POST':
form = CadastroForm(request.POST)
return render(request, 'cadastro1.html',
{'form': CadastroForm()})
Hi Vitor, thanks for the help, it worked yes, it is redirecting to the other page as I wanted...
– Bianca C.
However what I need to solve now is the following, the user filled the email and sent, with this redirected to the second part of the form, after completed, is not saving in the database anything...
– Bianca C.
@Biancac. creates another question explaining what was done and what the new problem, which is easier than here in the comments :)
– mazulo