Django save an image asynchronous during a request -


i need save image on amazon ws s3 using django. have code:

try:                     img_temp = namedtemporaryfile(delete=true)                     img_temp.write(urllib2.urlopen(urlimageto download).read())                     img_temp.flush()                     p.image.save('image.jpg', file(img_temp))                     p.save() //p imagefield                  except urllib2.httperror:                     continue 

i integrated django-storages save directly image in amazon s3. have save image during request (in request have url of image have download , resave in amazon s3) think can have line:

p.image.save('image.jpg', file(img_temp))

asynchronous.

in case can return response of request while can save image on s3 how can have this? possible?


Comments

Popular posts from this blog

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

java - Could not locate OpenAL library -

sorting - opencl Bitonic sort with 64 bits keys -