diff --git a/storages/backends/s3boto3.py b/storages/backends/s3boto3.py index 0124c65b8..cb4164dc6 100644 --- a/storages/backends/s3boto3.py +++ b/storages/backends/s3boto3.py @@ -347,6 +347,8 @@ def _get_or_create_bucket(self, name): "region than we are connecting to. Set " "the region to connect to by setting " "AWS_S3_REGION_NAME to the correct region." % name) + + elif err.response['ResponseMetadata']['HTTPStatusCode'] == 404: # Notes: When using the us-east-1 Standard endpoint, you can create # buckets in other regions. The same is not true when hitting region specific # endpoints. However, when you create the bucket not in the same region, the @@ -364,11 +366,6 @@ def _get_or_create_bucket(self, name): bucket_params['CreateBucketConfiguration'] = { 'LocationConstraint': region_name} bucket.create(ACL=self.bucket_acl) - else: - raise ImproperlyConfigured("Bucket %s does not exist. Buckets " - "can be automatically created by " - "setting AWS_AUTO_CREATE_BUCKET to " - "``True``." % name) return bucket def _clean_name(self, name):