Skip to content
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

Revert "Switch STATICFILES_STORAGE, to work around a bug with drf-yasg" #176

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 5 additions & 0 deletions composed_configuration/_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ class TestingBaseConfiguration(MinioStorageMixin, _BaseConfiguration):

MINIO_STORAGE_MEDIA_BUCKET_NAME = 'test-django-storage'

# To generate static file URLs in testing (where DEBUG is False),
# CompressedManifestStaticFilesStorage requires collectstatic to be run,
# so use an alternative which does not require that
STATICFILES_STORAGE = 'whitenoise.storage.CompressedStaticFilesStorage'

# Testing will set EMAIL_BACKEND to use the memory backend


Expand Down
4 changes: 1 addition & 3 deletions composed_configuration/_static.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,4 @@ def mutate_configuration(configuration: Type[ComposedConfiguration]) -> None:
security_index + 1, 'whitenoise.middleware.WhiteNoiseMiddleware'
)

# CompressedManifestStaticFilesStorage does not work properly with drf-
# https:/axnsan12/drf-yasg/issues/761
STATICFILES_STORAGE = 'whitenoise.storage.CompressedStaticFilesStorage'
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'