Django: Know when a file is already saved after usign storage.save()
No magic solution here. You have to manage states on your model, specially when working with celery tasks. You might need another field called state with the states: NONE (no action is beeing done), PROCESSING (task was sent to celery to process) and DONE (image was rotated)
NONE is the default state. you should set the POCESSING state before calling the celery task (and not inside the celery task, already had bugs because of that) and finally the celery task should set the status to DONE when finished.
When the task is fast the user will not see any difference but when it takes some time you might want to add a message "image is being processed, please try again" or something like that
At least that's how I do it... Hope this helps
So I've a Django model which has a FileField. This FileField, contains generally an image. After I receipt the picture from a request, I need to run some picture analysis processes. 
The problem is that sometimes, I need to rotate the picture before running the analysis (which runs in celery, loading the model again getting the instance by the id). So I get the picture, rotate it and save it with:
storage.save(image_name, new_image_file), where storage is the django default storage (using AWS S3)
The problem is that in some minor cases (lets say 1 in 1000), the picture is not already rotated when running the analysis process in celery, after the rotation process was executed, but after that, if I open the image, is already rotated, so it seems that the save method is taking some time to update the file in the storage, (asynchronously)...
Have anyone had a similar issue? Is there a way to check if the file was already updated, like with a callback or a kind of handler?
Many thanks!