Skip to content

Commit

Permalink
[s3] Deprecate additional settings (#829)
Browse files Browse the repository at this point in the history
  • Loading branch information
jschneier authored Feb 3, 2020
1 parent b1ae163 commit de2515a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docs/backends/amazon-S3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ To allow ``django-admin.py`` collectstatic to automatically put your static file
``AWS_S3_ENCRYPTION`` (optional; default is ``False``)
Enable server-side file encryption while at rest.

.. deprecated:: 1.9

Support for this top level setting is deprecated. The functionality is still available by setting
ServerSideEncryption=AES256 in AWS_S3_OBJECT_PARAMETERS.

``AWS_S3_FILE_OVERWRITE`` (optional: default is ``True``)
By default files with the same name will overwrite each other. Set this to ``False`` to have extra characters appended.

Expand Down
21 changes: 21 additions & 0 deletions storages/backends/s3boto3.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,27 @@ def __init__(self, acl=None, bucket=None, **settings):
"Unset AWS_AUTO_CREATE_BUCKET (it defaults to False) to silence this warning.",
DeprecationWarning,
)
if self.reduced_redundancy:
warnings.warn(
"Support for AWS_REDUCED_REDUNDANCY will be removed in version 2.0. "
"Update now by adding StorageClass=REDUCED_REDUNDANCY to "
"AWS_S3_OBJECT_PARAMETERS. There are also several other possible values "
"for StorageClass available. Check the AWS & boto3 docs for more info.",
DeprecationWarning,
)
if self.encryption:
warnings.warn(
"Support for AWS_S3_ENCRYPTION will be removed in version 2.0. "
"Update now by adding ServerSideEncryption=AES256 to "
"AWS_S3_OBJECT_PARAMETERS. Doing so also easily allows using 'aws:kms' "
"for encryption. Check the AWS & boto3 docs for more info.",
DeprecationWarning,
)
if self.preload_metadata:
warnings.warn(
"Support for AWS_PRELOAD_METADATA will be removed in version 2.0. ",
DeprecationWarning,
)

check_location(self)

Expand Down

0 comments on commit de2515a

Please sign in to comment.