我的设置如下:
STATIC_ROOT = BASE_DIR + '/static'
YOUR_S3_BUCKET = "tlot-static"
# DEFAULT_FILE_STORAGE = "django_s3_storage.storage.S3Storage"
STATICFILES_STORAGE = "django_s3_storage.storage.StaticS3Storage"
AWS_S3_BUCKET_NAME = AWS_S3_BUCKET_NAME_STATIC = YOUR_S3_BUCKET
# These next two lines will serve the static files directly
# from the s3 bucket
AWS_S3_CUSTOM_DOMAIN = '%s.s3.amazonaws.com' % YOUR_S3_BUCKET
STATIC_URL = "https://%s/" % AWS_S3_CUSTOM_DOMAIN
但我不断得到:
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>AccessDenied</Code><Message>Access Denied</Message><RequestId>9F85922419DD93C0</RequestId><HostId>5lV1ft+jAOTvnqCvOC/fMSolHXS8foJde8XP1LxtYytlZLjejA2gvjIurYwt9Fn8Jxlgvy5IjOI=</HostId></Error>
这些文件已使用 collectstatic 成功部署,并且我已根据存储桶上的文档设置了 cors。我还需要做什么?