Answer the question
In order to leave comments, you need to log in
How not to lose data when submitting a form (view with LoginRequiredMixin) if the user is not authorized?
Good time of the year.
We set the task to make a tricky mechanism for sending an application from the site (about 10 fields) for users. Namely, if the visitor is NOT authorized, then direct him to the login and registration page (there are two forms side by side), but when he enters / registers, attach to him all the data that he filled out in the form.
A similar mechanism can be observed in almost all modern online stores (Yulmart, for example), when you first put everything in the basket, arrange delivery, choose a payment method, and only then they say - "now let's register or enter the site if you are already registered" and only after these actions - the order flies to the server as a "placed order".
LoginRequiredMixin
(class-based), then you can pass not only next
a parameter for the URL, but also save it (in the session / cookies? ) any other data?Perhaps this is the answer to my problem, but I want to hear a more authoritative opinion of Django practitioners, and not my own guesses :)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question