pydanny / dj-libcloud

Adds easy python 3 and 2.7 support to Django for management of static assets.
BSD 3-Clause "New" or "Revised" License
53 stars 4 forks source link

S3 Regions #10

Closed aleksisg closed 10 years ago

aleksisg commented 10 years ago

I'm trying to use a bucket in EU-West-1.

I keep getting: <LibcloudError in <class 'libcloud.storage.drivers.s3.S3StorageDriver'> 'This bucket is located in a different region. Please use the correct driver.'>

I can't find a way to change the driver. Settings only seem to allow a generic S3 driver, with no option for region. Am I missing something?

pydanny commented 10 years ago

Did you try this?:

LIBCLOUD_PROVIDERS = {
    'amazon_s3_eu_west': {
        'type': 'libcloud.storage.types.Provider.S3_EU_WEST',
        'user': os.environ.get('AWS_ACCESS_KEY'),
        'key': os.environ.get('AWS_SECRET_KEY'),
        'bucket': 'my-assets-cdn',
        'secure': True,
    }
}

DEFAULT_LIBCLOUD_PROVIDER = 'amazon_s3_eu_west'

Note: I didn't have time to test this. let me know how it goes.

aleksisg commented 10 years ago

That worked! Thank you.

pydanny commented 10 years ago

Hooray! I'll add it to the cookbook right now,