1

I currently have one bucket for static files, this is the settings.py:

AWS_STORAGE_BUCKET_NAME = 'leleaseca'
STATICFILES_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
S3_URL = 'https://%s.s3.amazonaws.com/' % AWS_STORAGE_BUCKET_NAME
STATIC_URL = S3_URL

I would like to add another bucket for user uploaded media. It is not clear to me how this can be accomplished. I've found an answer suggesting that there is a way for S3BotoStorage to take the bucket name as a parameter. There was no example given for this part, so I imagine it is something like this:

STATICFILES_STORAGE = 'storages.backends.s3boto.S3BotoStorage("bucket1")'
STATIC_URL = 'https://bucket1.s3.amazonaws.com/'

DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage("bucket2")'
MEDIA_URL = 'https://bucket2.s3.amazonaws.com/'

I doubt that this is what he meant, but this is in pseudocode what I want to accomplish.

Community
  • 1
  • 1
davidtgq
  • 3,780
  • 10
  • 43
  • 80

0 Answers0