1
There are couple of solutions
- Define another model to just hold images, and add may be OneToOneField in your Post model. On submitting page1, create instance of this image model and put it in page2 as image field.
- With html5 file API, you can refer to local file in image field. So you can show image on page2 using local client side path w/o storing it at server. refer: View image selected from file-system on client-side before upload?
0
First read the relevant doc so you understant what happens with uploaded files:
https://docs.djangoproject.com/en/dev/topics/http/file-uploads/
The simplest solution IMHO would be to
1/ save the uploaded file in some temporary directory – just make sure you can serve the content one way or another (either directly thru the front webserver, or thru a custom view if you want more control on who can access this content),
2/ pass the temporary file path and url to the “next” view one way or another (hidden form fields, session…).
- [Django]-Use context processor only for specific application
- [Django]-Django with django-nose: two identical settings files with different behavior in running test command
- [Django]-Django using curry to build formsets with custom form
- [Django]-Allowing basic html markup in django
0
I use to have table to store images (any files in fact :)). Each image is linked to object (FK) and has status – Draft, Approved, Deleted. So I don’t use temporary directory, just change status in table of images.
- [Django]-Django AllAuth gives SSLError
- [Django]-Testing Django project, how can I avoid Errno 10054?