Closed jorgeas80 closed 7 years ago
More info: I've uninstalled boto 2.45 (or I thought so...), by
pip uninstall boto
But still here
heroku run pip freeze | grep boto
boto==2.45.0
At same time, installing boto3 has no effect. And pip never says Requirement already satisfied. It always downloads and install boto3... but not really. Never shown in pip freeze.
And finally an even stranger... If I start a bash shell in my heroku instance
heroku run bash
Manually uninstall boto 2.45 and install boto3...
pip uninstall boto
pip install boto3
boto3 is correctly installed. But then I exit, and run a shell again.... and boto 3 dissapeared! boto 2.45 again here.
Why?? Am I entering into a "ghost" session and everything is deleted when I logout?
Ok, solved. I had to replace
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
I'm using python 3, by the way.
Not sure if this is pull request material or not. What do you think, guys?
Which version of Python 3 are you using?
Anyway, a PR would be nice. I'll test it on Heroku and see what happens.
./manage.py collectstatic worked fine for static files for me. Media would not work with boto-rsync or django extensions. I fixed it by creating a bucket in the default US region, then used django extensions management command $ ./manage.py sync_s3 --media-only --s3host=s3.us-east-1.amazonaws.com
then copied and pasted to my EU central region bucket using the AWS website s3 console finder.
I used instructions here for setup https://wagtail.io/blog/amazon-s3-for-media-files/
Ok, solved. I had to replace
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 problemI'm using python 3, by the way.
Not sure if this is pull request material or not. What do you think, guys?
I just wanted to say thank you! I changed "boto3=1.23.4" to "boto3=1.4.4" and now the django development server is running for me! Good work.
I've managed to deploy my Django cookiecutter app in Heroku, but admin interface can't properly load CSS / JS resources because collectstatic fails.
This is the raw output when running collectstatic
I've manually installed boto3 in heroku by doing this:
heroku run pip install boto3
But nothing changes.
The problem is in file app/.heroku/python/lib/python3.5/site-packages/storages/backends/s3boto3.py. Specifically, those lines:
To confirm, I enter the python shell
heroku run python manage.py shell
And try to manually import those files. For example
import boto3.session
Getting the same error
Last test, run a pip freeze
heroku run pip freeze
No boto 3 listed, of course. No way of running collectstatic.
What am I doing wrong?