[Django]-Architecture for syncing s3/cloudfront with database

0👍

Found the same problem in the past, maybe not the best advice but here’s what I did.

I wrote the upload/modify/remove to S3 logic in the models and used Model signals to keep it updated, for example you can use the post_delete signal to delete the image from S3 and avoid orphans.

Also I had a management command to check if everything is synchronized and solve the problems if any. Unfortunately I wrote this for a client and I cannot share it.

Edit: I found django-cb-storage-s3 and django-s3sync they could be helpful

Leave a comment