django-boto
django-boto copied to clipboard
BOTO_S3_HOST Setting Ignored
I'm writing a Django app that uses DreamObjects for S3 compatible storage. In order to get django-boto to use the correct host, I have tried setting the BOTO_S3_HOST option to 'objects.dreamhost.com' as documented (http://ceph.com/docs/master/radosgw/s3/python/) .
Creating a test key/value using that documentation above specifying objects.dreamhost.com in boto.connect_s3() method allows me to upload and generally do whatever I need to do. However trying to use the same value in BOTO_S3_HOST seems to be ignored in the actual Django app, producing the following trace. I confirmed that boto is trying to reach out to [bucketname].s3.amazonaws.com instead of [bucketname].objects.dreamhost.com via a packet capture from the app server. Running django-storages-redux as the storages communication.
Relevant settings.py configuration:
INSTALLED_APPS = ( 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'unflap', 'djrill', 'sorl.thumbnail', 'storages',
)
BOTO_S3_HOST = 'objects.dreamhost.com'
DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage' AWS_ACCESS_KEY_ID = omitted AWS_SECRET_ACCESS_KEY = omitted AWS_STORAGE_BUCKET_NAME = 'unflap.development' STATICFILES_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
403 Forbidden traceback triggered because it's trying to hit s3.amazon.aws.com instead of objects.dreamhost.com
Traceback (most recent call last):
File "manage.py", line 10, in
This package haven't full boto api support and targeted to original Amazon S3 service. I will check your request when i'll have free time for it.
Feel free to send pull request with related changes if you fix it yourself.
I can try to take a look, I was just confused since that's a direct option given in the readme file as something that should work. Either that or update the documentation to pull that option until it works. I know I'm likely an edge case.
Per readme: " BOTO_S3_HOST Amazon S3 hostname. Default to s3.amazonaws.com ."