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

Improve configuration of default storage #359

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ron8mcr
Copy link

@ron8mcr ron8mcr commented Mar 17, 2023

Previously it was set using str with dotted path to storage, so StorageHealthCheck.get_storage initialize it on every call. This may lead to redundant calls to external APIs (see boto/boto3#3614)

Meanwhile django.core.files.storage.default_storage is lazy object that can be safely used as class attribute, and single storage object may be reused

Also fixes #366

Previously it was set using `str` with dotted path to storage, so
`StorageHealthCheck.get_storage` initialize it on every call. This may
lead to redundant calls to external APIs (see
boto/boto3#3614)

Meanwhile `django.core.files.storage.default_storage` is lazy object
that can be safely used as class attribute, and single `storage` object
may be reused
@vanya909
Copy link

vanya909 commented Sep 6, 2023

@frankwiles Hello, can you please check this PR? Just curious about will I be able to use this feature soon

@ron8mcr
Copy link
Author

ron8mcr commented Mar 13, 2024

Hi @frankwiles, could you please take a loot at this one or at #408 or #383 ?
Without this fix, django-health-check cannot be used with newer versions of Django (see https://docs.djangoproject.com/en/dev/releases/5.1/#features-removed-in-5-1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide a fix to avoid " The DEFAULT_FILE_STORAGE setting is deprecated"
2 participants