I created a s3 space with Digitalocean. I upload files into this one with ckeditor in a django project. I have no problem for uploading files but I meet a problem when I try to browse my server (to see if an image is already present)
Here is my code:
session = boto3.session.Session()
client = session.client('s3', region_name='fra1',
endpoint_url=settings.AWS_S3_ENDPOINT_URL,
aws_access_key_id=settings.AWS_ACCESS_KEY_ID,
aws_secret_access_key=settings.AWS_SECRET_ACCESS_KEY
)
resp = client.list_objects(Bucket=settings.AWS_STORAGE_BUCKET_NAME)
And an error happend the line where I call the function list_objects
An error occurred (NoSuchKey) when calling the ListObjects operation: Unknown
That's really stranger because I'm sure my settings.AWS_STORAGE_BUCKET_NAME is the correct one. Furthermore I'm sure there is no error in session.client because I use the same for uploading files, which works perfectly.
To make sure my bucket is the correct one I go to my AWS_S3_ENDPOINT_URL and got an XML with
<ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<Name>[MY BUCKET NAME]</Name>
<Prefix/>
<MaxKeys>1000</MaxKeys>
<IsTruncated>false</IsTruncated>
And after that begins a list of <Contents>
Thank you for your help