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

Manage custom storage class using django.core.files.storage.storages … #116

Merged
merged 1 commit into from
Apr 12, 2024

Conversation

JMSoler7
Copy link
Contributor

…modules instead of deprecated method

In Django documentation we can see that get_storage_class is deprecated in Django 5.1 and later.

https://docs.djangoproject.com/en/5.0/ref/files/storage/#django.core.files.storage.get_storage_class

Recommendation of Django is to use storages instead of get_storage_class. This leads to specify this file storage backend in STORAGES config settings instead of a new config variable.

This commit allows also to keep using custom storage classe from older verions (4.2 and earlier) and prevents to crash when invalid storage class is provided, using the default one.

Solves #115

…modules instead of deprecated method

In Django documentation we can see that get_storage_class is deprecated in Django 5.1 and later.

https://docs.djangoproject.com/en/5.0/ref/files/storage/#django.core.files.storage.get_storage_class

Recommendation of Django is to use storages instead of get_storage_class. This leads to specify
this file storage backend in STORAGES config settings instead of a new config variable.

This commit allows also to keep using custom storage classe from older verions (4.2 and earlier) and
prevents to crash when invalid storage class is provided, using the default one.

Solves auto-mat#115
@timthelion timthelion merged commit 2064e2d into auto-mat:master Apr 12, 2024
@PetrDlouhy
Copy link
Contributor

PetrDlouhy commented May 21, 2024

@JMSoler7 Does the storage identifier have to be exactly IMPORT_EXPORT_CELERY_STORAGE? That is not very typical identifier for a storage (Django uses default and staticfiles), I would name it something like import_export_celery.

What if I would like to reuse some already existing storage, like default to avoid configuring new storage and make it easier configure in different environments? Shouldn't allow to configure the storage identifier?

@PetrDlouhy
Copy link
Contributor

I added more proper fix in PR #123

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.

3 participants