Skip to content

Commit

Permalink
Version::1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
codewitgabi committed Jun 9, 2023
1 parent 6de4853 commit 8fb54ba
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions cloudvault/cloudvault/cloud_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from django.conf import settings
import cloudinary
from cloudinary.uploader import upload
from cloudinary import CloudinaryResource


class CloudinaryStorage(Storage):
Expand All @@ -15,7 +16,7 @@ def __init__(self) -> None:

def _save(self, name, content):
# upload file to cloudinary
response = upload(content.file, overwrite=False)
response = upload(content, overwrite=False, resource_type="auto")

# return cloudinary secure url
url = response["secure_url"]
Expand All @@ -34,12 +35,9 @@ def exists(self, name) -> bool:
"""
try:
response = cloudinary.api.resource(name)
print(response["exists"])

return response["exists"]
except:
return False




2 changes: 1 addition & 1 deletion cloudvault/setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = cloudvault
version = 1.1
version = 1.2
description = A Django package for managing file uploads to cloud[Cloudinary]. It is an alternative for AWS S-3 Bucket.
long_description = file: README.md
long_description_content_type = text/markdown
Expand Down

0 comments on commit 8fb54ba

Please sign in to comment.