Skip to content

Use django-storages' manifest files class instead of the overriden class #8781

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Mar 7, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion readthedocs/settings/docker_compose.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def show_debug_toolbar(request):
# Storage backend for build languages
RTD_BUILD_TOOLS_STORAGE = 'readthedocs.storage.s3_storage.S3BuildToolsStorage'
# Storage for static files (those collected with `collectstatic`)
STATICFILES_STORAGE = 'readthedocs.storage.s3_storage.S3StaticStorage'
STATICFILES_STORAGE = 'storages.backends.s3boto3.S3ManifestStaticStorage'

AWS_ACCESS_KEY_ID = 'admin'
AWS_SECRET_ACCESS_KEY = 'password'
Expand Down
17 changes: 0 additions & 17 deletions readthedocs/storage/s3_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,6 @@
from .mixins import OverrideHostnameMixin, S3PrivateBucketMixin


class S3BuildMediaStorage(BuildMediaStorageMixin, OverrideHostnameMixin, S3Boto3Storage):

"""An AWS S3 Storage backend for build artifacts."""

bucket_name = getattr(settings, 'S3_MEDIA_STORAGE_BUCKET', None)
override_hostname = getattr(settings, 'S3_MEDIA_STORAGE_OVERRIDE_HOSTNAME', None)

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)

if not self.bucket_name:
raise ImproperlyConfigured(
'AWS S3 not configured correctly. '
'Ensure S3_MEDIA_STORAGE_BUCKET is defined.',
)


class S3BuildCommandsStorage(S3PrivateBucketMixin, S3Boto3Storage):

"""An AWS S3 Storage backend for build commands."""
Expand Down