Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the API call for creating S3 bucket optional #12

Open
radeksimko opened this issue May 16, 2014 · 0 comments
Open

Make the API call for creating S3 bucket optional #12

radeksimko opened this issue May 16, 2014 · 0 comments

Comments

@radeksimko
Copy link
Contributor

The first time you access the S3 bucket, an extra request is being made to S3 which is in most cases useless.

https://github.com/qnub/django-boto/blob/master/django_boto/s3/storage.py#L42-45

    @property
    def bucket(self):
        if not self._bucket:
            self.s3 = connect_s3(aws_access_key_id=self.key, aws_secret_access_key=self.secret, host=self.host)

            try:
                self._bucket = self.s3.create_bucket(self.bucket_name, location=self.location, policy=self.policy)
            except (S3CreateError, S3ResponseError):
                self._bucket = self.s3.get_bucket(self.bucket_name)
        return self._bucket

I understand that the original reason might have been to make it more convenient by not having to go to AWS console and creating the bucket there but there should be a way how to turn this off and maybe even not doing it by default (that might be arguable).

You might not always value the convenience over performance & costs (though I know the cost per request is very low, it's not zero exactly because of preventing doing things like this).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant