【问题标题】:Is this a problem Deploying Heroku before working in AWS?这是在 AWS 工作之前部署 Heroku 的问题吗?
【发布时间】:2021-09-09 14:16:07
【问题描述】:

我已经在 Heroku 上部署了我的网站,没有任何问题。之后,我已将我的静态和媒体文件夹上传到 AWS,但出现此错误:

raise ImproperlyConfigured("Could not load Boto3's S3 bindings. %s" % e)
 django.core.exceptions.ImproperlyConfigured: Could not load Boto3's S3 bindings.
 No module named 'boto3'

我已经安装了所有东西,我已经完成了pip freeze < requirements.text。 请帮帮我。

【问题讨论】:

    标签: django amazon-s3 heroku


    【解决方案1】:
     I had to replace following using python3
    
    boto==2.45.0
    
    With
    
    boto3==1.4.4
    
    In requirements/production.txt and push to heroku again.
    
    I also had to replace
    
    MEDIA_URL = 'https://s3.amazonaws.com/%s/media/' % AWS_STORAGE_BUCKET_NAME
    STATIC_URL = 'https://s3.amazonaws.com/%s/static/' % AWS_STORAGE_BUCKET_NAME
    with
    
    MEDIA_URL = 'https://s3.amazonaws.com:443/%s/media/' % AWS_STORAGE_BUCKET_NAME
    STATIC_URL = 'https://s3.amazonaws.com:443/%s/static/' % AWS_STORAGE_BUCKET_NAME
    in config/settings/production.py. But not sure it this last thing is just my problem
    

    【讨论】:

      猜你喜欢
      • 2015-06-05
      • 2016-05-11
      • 2017-05-04
      • 2013-06-17
      • 2023-04-10
      • 2021-02-28
      • 2020-05-12
      • 2020-07-13
      相关资源
      最近更新 更多