From d2dd265a9968740ddf6e59686c4ec520e4d52ff2 Mon Sep 17 00:00:00 2001 From: Pierre Chiquet Date: Wed, 13 Dec 2017 14:06:48 +0100 Subject: [PATCH] Fix MediaRootS3BotoStorage: do not override existing files (#1367) * Fix MediaRootS3BotoStorage: do not override existing files see https://github.com/jschneier/django-storages/issues/50 * Update "other contributors" * alphabetical order --- CONTRIBUTORS.rst | 1 + {{cookiecutter.project_slug}}/config/settings/production.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index 08bca907..4cf632db 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -127,6 +127,7 @@ Listed in alphabetical order. Pablo `@oubiga`_ Parbhat Puri `@parbhat`_ Peter Bittner `@bittner`_ + Pierre Chiquet `@pchiquet`_ Raphael Pierzina `@hackebrot`_ Raony GuimarĂ£es CorrĂªa `@raonyguimaraes`_ Reggie Riser `@reggieriser`_ diff --git a/{{cookiecutter.project_slug}}/config/settings/production.py b/{{cookiecutter.project_slug}}/config/settings/production.py index 9eeb46bc..db581306 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -120,7 +120,7 @@ DEFAULT_FILE_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage' # See:http://stackoverflow.com/questions/10390244/ from storages.backends.s3boto3 import S3Boto3Storage StaticRootS3BotoStorage = lambda: S3Boto3Storage(location='static') # noqa -MediaRootS3BotoStorage = lambda: S3Boto3Storage(location='media') # noqa +MediaRootS3BotoStorage = lambda: S3Boto3Storage(location='media', file_overwrite=False) # noqa DEFAULT_FILE_STORAGE = 'config.settings.production.MediaRootS3BotoStorage' MEDIA_URL = 'https://s3.amazonaws.com/%s/media/' % AWS_STORAGE_BUCKET_NAME