jira-15 dashboard API

This commit is contained in:
jain
2023-07-06 12:21:54 +05:30
parent a80f603614
commit cf966a5250
10 changed files with 76 additions and 42 deletions

View File

@ -10,5 +10,9 @@ def upload_image_to_alibaba(image, filename):
bucket = oss2.Bucket(auth, settings.ALIYUN_OSS_ENDPOINT, settings.ALIYUN_OSS_BUCKET_NAME)
# Upload the temporary file to Alibaba OSS
bucket.put_object_from_file(filename, temp_file.name)
return f"https://{settings.ALIYUN_OSS_BUCKET_NAME}.{settings.ALIYUN_OSS_ENDPOINT}/{filename}"
print("filename====>",filename,'===>',type(filename))
new_filename = filename.replace(' ', '%20')
print()
print("filename====>", filename, '===>', type(filename))
return f"https://{settings.ALIYUN_OSS_BUCKET_NAME}.{settings.ALIYUN_OSS_ENDPOINT}/{new_filename}"