Skip to content

Commit

Permalink
setting GZIP_CONTENT_TYPES and ACL to defaults that can be overriden …
Browse files Browse the repository at this point in the history
…in the settings
  • Loading branch information
emamd committed Jun 2, 2014
1 parent 68eb26b commit 4aaacec
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions bakery/management/commands/publish.py
Expand Up @@ -53,7 +53,7 @@
'application/json',
'application/xml'
)
ACL = 'public-read'
DEFAULT_ACL = 'public-read'


class Command(BaseCommand):
Expand Down Expand Up @@ -157,7 +157,7 @@ def sync_s3(self):
for file_key in self.local_files:
# store a reference to the absolute path, if we have to open it
abs_file_path = os.path.join(self.build_dir, file_key)

# check if the file exists
if file_key in self.keys:
key = self.keys[file_key]
Expand Down Expand Up @@ -190,8 +190,12 @@ def handle(self, *args, **options):
"""
Sync files in the build directory to a specified S3 bucket
"""
self.gzip_content_types = GZIP_CONTENT_TYPES
self.acl = ACL
self.gzip_content_types = getattr(
settings,
'GZIP_CONTENT_TYPES',
GZIP_CONTENT_TYPES
)
self.acl = getattr(settings, 'ACL', DEFAULT_ACL)
self.uploaded_files = 0
self.deleted_files = 0
start_time = time.time()
Expand Down

0 comments on commit 4aaacec

Please sign in to comment.