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