Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 20057

Django CloudinaryField: Setting Default Privacy on Upload and Generating Presigned URLs for Public Access

$
0
0

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:

  1. Default Upload Privacy: How can I set the default privacy of the uploaded images to be private?

  2. 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!


Viewing all articles
Browse latest Browse all 20057

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>