You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have configured the storage to upload the static file into a digital ocean storage( comaptible with S3).
When I run collectstatic I am able to upload some files, because it appears in the server, and I am able to consume those files. But in the middle of the command collectstatic it breaks and return this error:
botocore.exceptions.ClientError: An error occurred () when calling the PutObject operation:
The error is empty :(
Also, I have created a simple python script with 'os' and 'boto3' to upload my static folder "manually" and all the files were uploaded correctly.
So I think that the error should be in the here, in the library.
response = client.list_buckets()
for space in response['Buckets']:
print(space['Name'])
for f in files:
print(f)
client.upload_file(f, "xxx", f,ExtraArgs={'ACL': 'public-read'})`
Thanks in advice
The text was updated successfully, but these errors were encountered:
@fozdemir40 my error was that digital ocean don't accept a large amount of upload per second. AndI imagine that collectstatic upload faster than digital ocean. I tried S3 from amazon and my problem was solved.
Also, I didn't check the #968, because I was just realize that comment.
I don't know if your problem is at DO, maybe could be the same thing.
Hello,
I have configured the storage to upload the static file into a digital ocean storage( comaptible with S3).
When I run collectstatic I am able to upload some files, because it appears in the server, and I am able to consume those files. But in the middle of the command collectstatic it breaks and return this error:
botocore.exceptions.ClientError: An error occurred () when calling the PutObject operation:
The error is empty :(
Also, I have created a simple python script with 'os' and 'boto3' to upload my static folder "manually" and all the files were uploaded correctly.
So I think that the error should be in the here, in the library.
I will attach the setting.py and the other code.
`AWS_ACCESS_KEY_ID = 'xxx'
AWS_SECRET_ACCESS_KEY = 'xxx'
AWS_STORAGE_BUCKET_NAME = 'xxx'
AWS_S3_ENDPOINT_URL = 'https://fra1.digitaloceanspaces.com'
AWS_S3_OBJECT_PARAMETERS = {
'CacheControl': 'max-age=86400',
}
AWS_LOCATION = 'static_django'
AWS_DEFAULT_ACL = None
STATICFILES_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
STATIC_URL = '{}/{}/'.format(AWS_S3_ENDPOINT_URL, AWS_LOCATION)
STATIC_ROOT = 'static/'
STATICFILES_DIRS = [
STATIC_DIR,
]`
Python script manual upload:
`import os
import boto3
path = 'assets'
files = []
r=root, d=directories, f = files
for r, d, f in os.walk(path):
for file in f:
files.append(os.path.join(r, file))
for f in files:
print(f)
session = boto3.session.Session()
client = session.client('s3',
region_name='fra1',
endpoint_url='https://fra1.digitaloceanspaces.com',
aws_access_key_id=('xx'),
aws_secret_access_key=('xxx'))
print(client)
response = client.list_buckets()
for space in response['Buckets']:
print(space['Name'])
for f in files:
print(f)
client.upload_file(f, "xxx", f,ExtraArgs={'ACL': 'public-read'})`
Thanks in advice
The text was updated successfully, but these errors were encountered: