I'm working on a Django project where I have a model Media with an image field stored using CloudinaryField.
Currently, I'm able to upload images via multipart/form, and I can generate a public link using media_object.image.url. However, I'm facing two challenges:
Default Upload Privacy: How can I set the default privacy of the uploaded images to be private?
Generating Presigned URLs: I need to generate presigned URLs for public access to these images, but I want these URLs to expire after a certain period, say 5 minutes.
Here's what my current model looks like:
from django.db import modelsfrom cloudinary.models import CloudinaryFieldclass Media(models.Model): # Other fields... image = CloudinaryField('document', null=True, blank=True)Could someone please guide me on how to achieve these two objectives? Any help or pointers would be greatly appreciated. Thanks!