I am struggling to find a solution for a photo gallery in django. I’ve checkout out every django photo package (photologue, imagekit, etc.) I could find an none of them are really helping me in my quest. I am trying to build a simple image gallery that will allow me to upload multiple photos from the django admin and store them directly in Amazon S3. Can someone please point me to a simple photo app capable of achieving this or what would be the simplest approach?
Thank you so much
Advertisement
Answer
This can be accomplished with django-storages configured to use S3. After setting up django-storages with S3, you can simply use add the image field to your model:
some_image = models.ImageField(upload_to='images')
where images
is the subkey/directory in the bucket specified in your setup.
The process is outlined here and here.
In order to setup multi-image uploading, you can use: django-admin-multiupload or django-photologue (built-in S3 support) or see one of the similar questions: Uploading multiple images in Django admin