Issue
When user uploads images from (react as frontend) and django receives the images from static folder and begins to process those images and later user can download.
Below is my django python code
imagePath = os.path.commonprefix(['images']) #<------coming from static files when user
# upload via react axios.post. instead
# of "imagePath" i want django to read
# from s3 bucket 'images' folder.
#other process
for img in imagePath:
image = cv2.imread(img)
##other process
but now i'm using amzazon s3 instead of local static files.
AWS_ACCESS_KEY_ID = '********'
AWS_SECRET_ACCESS_KEY = '***************'
AWS_STORAGE_BUCKET_NAME = '********'
AWS_S3_FILE_OVERWRITE = False
AWS_DEFAULT_ACL = None
DEFAULT_FILE_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
STATICFILES_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
my question is :
How to make django to read images directly from s3 bucket? so that instead of "imagePath" i can use s3 files?
Any related answer will be really appreciated thank you :) I hope i get response ! i'am even ready to shift to any server if my code plan works there ! so give me any idea how to work my plan.
Hope i get some response !
Solution
Here Is the Best Solution. Link Image read by presignedurl and in Opencv.
Answered By - sangaraju Lokesh varma
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.