From de5504f41466006890d12562de96d110dcdc08c7 Mon Sep 17 00:00:00 2001 From: Wan Liuyang Date: Sun, 9 Sep 2018 19:59:04 +0800 Subject: [PATCH] Rename custom S3Boto3Storage subclasses (#1784) Closes #1788 This PR preps for the upcoming `django-storages` 2.X: 1. ~~Explicitly set default ACL to None which was [incorrectly set](https://github.com/jschneier/django-storages/blob/3f6ec7494253dd715598a41dd821fc09d6f45e40/storages/backends/s3boto3.py#L195) to `public-read` by `django-storages`~~ 2. Renamed `StaticRootS3BotoStorage` to `StaticRootS3Boto3Storage` to avoid confusion. This is to prep for the upcoming `S3Boto` class deprecation. See also: https://django-storages.readthedocs.io/en/latest/backends/amazon-S3.html#settings https://github.com/jschneier/django-storages/blob/master/CHANGELOG.rst --- .../config/settings/production.py | 8 ++++---- {{cookiecutter.project_slug}}/requirements/production.txt | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/{{cookiecutter.project_slug}}/config/settings/production.py b/{{cookiecutter.project_slug}}/config/settings/production.py index 606535d4..509455ed 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -86,7 +86,7 @@ AWS_S3_OBJECT_PARAMETERS = { {% if cookiecutter.use_whitenoise == 'y' -%} STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage' {%- else %} -STATICFILES_STORAGE = 'config.settings.production.StaticRootS3BotoStorage' +STATICFILES_STORAGE = 'config.settings.production.StaticRootS3Boto3Storage' STATIC_URL = f'https://s3.amazonaws.com/{AWS_STORAGE_BUCKET_NAME}/static/' {%- endif %} @@ -101,17 +101,17 @@ MEDIA_URL = f'https://s3.amazonaws.com/{AWS_STORAGE_BUCKET_NAME}/' from storages.backends.s3boto3 import S3Boto3Storage # noqa E402 -class StaticRootS3BotoStorage(S3Boto3Storage): +class StaticRootS3Boto3Storage(S3Boto3Storage): location = 'static' -class MediaRootS3BotoStorage(S3Boto3Storage): +class MediaRootS3Boto3Storage(S3Boto3Storage): location = 'media' file_overwrite = False # endregion -DEFAULT_FILE_STORAGE = 'config.settings.production.MediaRootS3BotoStorage' +DEFAULT_FILE_STORAGE = 'config.settings.production.MediaRootS3Boto3Storage' MEDIA_URL = f'https://s3.amazonaws.com/{AWS_STORAGE_BUCKET_NAME}/media/' {%- endif %} diff --git a/{{cookiecutter.project_slug}}/requirements/production.txt b/{{cookiecutter.project_slug}}/requirements/production.txt index 5d02e1c7..3a138303 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -13,5 +13,5 @@ raven==6.9.0 # https://github.com/getsentry/raven-python # Django # ------------------------------------------------------------------------------ -django-storages[boto3]==1.6.6 # https://github.com/jschneier/django-storages -django-anymail[mailgun]==4.2 # https://github.com/anymail/django-anymail +django-storages[boto3]==1.7.1 # https://github.com/jschneier/django-storages +django-anymail[mailgun]==4.2 # https://github.com/anymail/django-anymail \ No newline at end of file