这是我的代码:
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)
如何在变量'image_url'中获取图像的URL?
听起来好像您正在sharing_create_shared_link中寻找Dropbox Python SDK方法。
基本想法可能类似于:
dbx.sharing_create_shared_link(path)