Reputation: 73
Here is my code:
from main import settings
import dropbox
def create(request):
if request.method == "POST":
image = request.FILES['image']
dbx = dropbox.Dropbox(settings.DROPBOX_ACCESS_TOKEN)
imageName = "{}.{}".format(uuid.uuid4(), image._name.split('.')[-1])
path = settings.DROPBOX_FOLDER + imageName
response = dbx.files_upload(image, path)
How can I take url of image in a variable 'image_url'?
Upvotes: 0
Views: 224
Reputation: 16930
It sounds like you're looking for the sharing_create_shared_link method in the Dropbox Python SDK.
The basic idea would likely be something like:
dbx.sharing_create_shared_link(path)
Upvotes: 1