1

I feel so dumb now

I am trying to use django-storages

I installed

pip install django-storages

then, added 'storages', into settings.py

then in settings.py

DEFAULT_FILE_STORAGE = 'storages.backends.s3.S3Storage'
AWS_ACCESS_KEY_ID = 'xxx'
AWS_SECRET_ACCESS_KEY = 'yyy'
AWS_STORAGE_BUCKET_NAME = 'mybucketname'

and tried to see if default file storage is changed:

>>> from django.core.files.storage import default_storage
>>> print default_storage.connection
....
ImproperlyConfigured: Could not load amazon's s3 bindings.

what am I missing

doniyor
  • 36,596
  • 57
  • 175
  • 260

1 Answers1

1

According to the documentation:

There are two backend APIs for interacting with S3. The first is the s3 backend (in storages/backends/s3.py) which is simple and based on the Amazon S3 Python library.

and the source code:

try:
    from S3 import AWSAuthConnection, QueryStringAuthGenerator, CallingFormat
except ImportError:
    raise ImproperlyConfigured("Could not load amazon's S3 bindings.\nSee "
        "http://developer.amazonwebservices.com/connect/entry.jspa?externalID=134")

The storages.backends.s3.S3Storage backend requires the Amazon S3 library to be installed.

I might confuse the original library and the fork, but I think the point stays valid.

alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195
  • thanks Alex, i downloaded the file from the link and now it is working – doniyor Nov 11 '15 at 15:06
  • now I am getting `The bucket you are attempting to access must be addressed using the specified endpoint` because my bucket is in frankfurt but it is a different problem.. ( or any ideas? :) ) ? – doniyor Nov 11 '15 at 15:07
  • @doniyor yeah, it's probably this issue: http://stackoverflow.com/questions/25027462/aws-s3-the-bucket-you-are-attempting-to-access-must-be-addressed-using-the-spec. – alecxe Nov 11 '15 at 15:10