Update settings and calls to use the new Django storage API.

Review Request #13428 — Created Nov. 22, 2023 and submitted

Information

Djblets
release-5.x

Reviewers

Django 4.2 introduced a new way of configuring and accessing storage
backends. Rather than separate implementations for file storage and
static media storage, everything now goes through a STORAGES
backend dictionary and a storages instance dictionary.

We now configure these in our Djblets-provided settings and our test
settings, and update the dictionary for extension packaging. The
extension packaging will need further tests, as storage handler caches
can't reasonably be cleared (without a hack to clear cached properties),
but the old storage support appears to have also cached state. So it
should be fine, but testing will be needed as development continues.

The avatars tests has been updated to use the storages instance
dictionary instead of the deprecated get_storage_class() method.

This removes all storage-related warnings from the test storage-related
warnings from the test suite.

Unit tests pass.

Summary ID
Update settings and calls to use the new Django storage API.
Django 4.2 introduced a new way of configuring and accessing storage backends. Rather than separate implementations for file storage and static media storage, everything now goes through a `STORAGES` backend dictionary and a `storages` instance dictionary. We now configure these in our Djblets-provided settings and our test settings, and update the dictionary for extension packaging. The extension packaging will need further tests, as storage handler caches can't reasonably be cleared (without a hack to clear cached properties), but the old storage support appears to have also cached state. So it should be fine, but testing will be needed as development continues. The avatars tests has been updated to use the `storages` instance dictionary instead of the deprecated `get_storage_class()` method. This removes all storage-related warnings from the test storage-related warnings from the test suite.
72f8459c8af05ad6386e426a72040df5293440b1
maubin
  1. Ship It!
  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-5.x (1210347)
Loading...