I have created a custom storage backend, the file is called storages.py
and is placed in an app called core
:
from django.conf import settings
from storages.backends.s3boto import S3BotoStorage
class S3StaticBucket(S3BotoStorage):
def __init__(self, *args, **kwargs):
kwargs['bucket_name'] = getattr(settings, 'static.mysite.com')
super(S3BotoStorage, self).__init__(*args, **kwargs)
In settings.py
, I have the follwing:
STATICFILES_STORAGE = 'core.storages.S3StaticBucket'
DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
When I try to do python manage.py collectstatic
it shows the following error:
django.core.exceptions.ImproperlyConfigured: Error importing storage module core.storages: "No module named backends.s3boto"
And when I run python manage.py shell
and try to import the same:
>>>
>>> from django.conf import settings
>>> from storages.backends.s3boto import S3BotoStorage
>>>
Any idea what I'm doing wrong?