I ran tests with Django 4.2 alpha and sorl-thumbnail==12.9.0. The tests
pass but there is a deprecation warning because sorl-thumbnail uses
`THUMBNAIL_STORAGE = settings.DEFAULT_FILE_STORAGE`. I tried to change the
line in sorl-thumbnail to `THUMBNAIL_STORAGE =
settings.STORAGES["default"]`, and then many tests fail with error
messages such as "You can't use this format for your profile picture. Only
JPEG or PNG formats are accepted.". My conclusion is that
`settings.DEFAULT_FILE_STORAGE` is not the same as
`settings.STORAGES["default"]` in Django 4.2 alpha, and it looks like a
bug. Or is it a feature?
--
Ticket URL: <https://code.djangoproject.com/ticket/34273>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* resolution: => invalid
* component: Uncategorized => File uploads/storage
Comment:
> I tried to change the line in sorl-thumbnail to `THUMBNAIL_STORAGE =
settings.STORAGES["default"]`, and then many tests fail ...
`STORAGES["default"]` is a dictionary not a class name so you should use
`THUMBNAIL_STORAGE = settings.STORAGES["default"]["BACKEND"]` instead, see
[https://docs.djangoproject.com/en/4.2/ref/settings/#storages docs].
--
Ticket URL: <https://code.djangoproject.com/ticket/34273#comment:1>
Comment (by אורי):
Replying to [comment:1 Mariusz Felisiak]:
> > I tried to change the line in sorl-thumbnail to `THUMBNAIL_STORAGE =
settings.STORAGES["default"]`, and then many tests fail ...
>
> `STORAGES["default"]` is a dictionary not a class name so you should use
`THUMBNAIL_STORAGE = settings.STORAGES["default"]["BACKEND"]` instead, see
[https://docs.djangoproject.com/en/4.2/ref/settings/#storages docs].
It is written on https://docs.djangoproject.com/en/dev/releases/4.2/ :
The `DEFAULT_FILE_STORAGE` setting is deprecated in favor of
`STORAGES["default"]`.
You should write there how to convert from `settings.DEFAULT_FILE_STORAGE`
to `settings.STORAGES["default"]["BACKEND"]`
--
Ticket URL: <https://code.djangoproject.com/ticket/34273#comment:2>
Comment (by Mariusz Felisiak):
Replying to [comment:2 אורי]:
> It is written on https://docs.djangoproject.com/en/dev/releases/4.2/ :
> The `DEFAULT_FILE_STORAGE` setting is deprecated in favor of
`STORAGES["default"]`.
> You should write there how to convert from
`settings.DEFAULT_FILE_STORAGE` to
`settings.STORAGES["default"]["BACKEND"]`
It's deprecated in favor of `STORAGES["default"]` as it's more flexible
and gives more options. I don't see anything incorrect in this sentence.
It's not written as ''"... use `STORAGES["default"]` instead"''.
--
Ticket URL: <https://code.djangoproject.com/ticket/34273#comment:3>