Suppose I have a view which will take a POST request. After the validation check pass, I need to redirect the request to another HTML/view with a request with GET method:
def view1(request):
if request.POST:
form = TempForm(request.POST)
if form.is_valid():
return redirect(request, 'view2')
def view2(request):
if request.POST:
#POST stuff here
else:
#GET stuff here
My problem is that after the form.is_valid()
, the redirect request will be passed as a POST method. My ultimate goal is to redirect the view2 with GET method.
Can I do such thing in Django?