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](3f6ec74942/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
This commit is contained in:
Wan Liuyang 2018-09-09 19:59:04 +08:00 committed by GitHub
parent 8dddd913c2
commit de5504f414
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -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 %}

View File

@ -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