1

I have used django-storages and S3Boto on my current project.

All went well on my project when running on my windows machine under the dev webserver. uploads are automaticly uploaded to my S3 and any storage hold in a FileField automaticlly set to my S3 URL when using {{MEDIA_URL}}

Now, I didnt set anything in my MEDIA_URL.

Today, I have set up my site in an EC2 Amazon linux machine running apache and my site runs however any {{MEDIA_URL}} does not set to my S3 URL, the same code base is working perfectly on my windows dev webserver.

When I am uploading it does upload to my S3 but I can not refer to my S3 files within my templetes. What strange is that via the admin site I am able to get the S3 URL. so everything looks right but I probably doing somthing wrong.

How did I set my S3 storage :

On settings.py

DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
AWS_ACCESS_KEY_ID = "[my key]"
AWS_SECRET_ACCESS_KEY = "[my key]"
AWS_STORAGE_BUCKET_NAME ="[my bucket]"

Thats it, and its work like a charm on my dev enviorment.

Any ideas what I am doing wrong ?

4

0 回答 0