403错误 - Amazon S3& Heroku的

时间:2015-07-21 12:19:58

标签: python django heroku amazon-s3

在我的heroku服务器上尝试collectstatic时,出现以下错误:

Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
    utility.execute()
  File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/__init__.py", line 330, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/base.py", line 393, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/base.py", line 444, in execute
    output = self.handle(*args, **options)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 168, in handle
    collected = self.collect()
  File "/app/.heroku/python/lib/python2.7/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 107, in collect
    handler(path, prefixed_path, storage)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 305, in copy_file
    if not self.delete_file(path, prefixed_path, source_storage):
  File "/app/.heroku/python/lib/python2.7/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 218, in delete_file
    if self.storage.exists(prefixed_path):
  File "/app/.heroku/python/lib/python2.7/site-packages/storages/backends/s3boto.py", line 414, in exists
    return k.exists()
  File "/app/.heroku/python/lib/python2.7/site-packages/boto/s3/key.py", line 539, in exists
    return bool(self.bucket.lookup(self.name, headers=headers))
  File "/app/.heroku/python/lib/python2.7/site-packages/boto/s3/bucket.py", line 142, in lookup
    return self.get_key(key_name, headers=headers)
  File "/app/.heroku/python/lib/python2.7/site-packages/boto/s3/bucket.py", line 192, in get_key
    key, resp = self._get_key_internal(key_name, headers, query_args_l)
  File "/app/.heroku/python/lib/python2.7/site-packages/boto/s3/bucket.py", line 230, in _get_key_internal
    response.status, response.reason, '')
boto.exception.S3ResponseError: S3ResponseError: 403 Forbidden

在我的IAM用户策略中,我已将AmazonS3FullAccess添加到用户。

有人知道如何解决这个问题吗?

谢谢!

0 个答案:

没有答案