I would like to upload a file with data to Django, and use django's forms to validate the data.
My idea was to have two views:
- A form where the user selecte the upload file The file is uploaded to thy server
- When the file successfully we are redirected to a from processing view, where the data in the file is used to populate the form and process it.
According to this anser, you can't POST data with a redirect: Django: How do I redirect a post and pass on the post data
Is there a common pattern to achieve this sort of behaviour?
I could easily use the initail kwarg to the form / view to populate it but the user needs to submit the from from the second page. I would like to process the form from the get request without the user needing to manually submit the initial form (a redirect with POST essentially).
(If this can be cleanly achived with generic class based views, all the better).