Django: How to redirect users to pages based on form input?
If by "subpage" you mean that you don't want any page reload, i would recommend dealing with this problem using js and not using a classical Form/Post method.
If you want to keep the logic in your views.py, one way you could do this is sending the form using Ajax, and displaying the result in your page.
I am creating a webpage that should redirect its users to a subpage, based on their choices in a form with radio buttons. The radio button input should trigger logic calculations. For example:
Form with example user input (Yes/No):

[Question] | [Yes] | [No]
Question1 | ------ | XXX
Question2 | ------ | XXX
Question3 | XXX | ------

Logic:

If Q1=No, Q2=No and Q3=Yes, then redirect to page W
If Q1=Yes, Q2=No and Q3=Yes, then redirect to page X
If Q2=Yes, then redirect to page Y
Else, then redirect to page Z

The webpage is part of a project created using Django and Python.
I do not know how to approach this problem, as the form input should be passed to the webserver while maintaining the possibility to perform the logic calculations.
Also, I do not want to store the user input to my database. After a user has been redirected to page W, X, Y or Z, no input should be memorized.
Can you please help me in finding a proper way to post the user form data to the server, perform the logic calculations and using the result to redirect the user to the right page?
Thank you in advance!
--
Thank you for your reply. I have tried your suggestion, but eventually chose for a workaround where I implemented IF-statements based on the form outcome. The content of the page following on the user input form thus dependent on the answers.