﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
34773	settings.STATICFILES_STORAGE does not return correct value when STORAGES are defined	Petr Dlouhý	Mariusz Felisiak	"I transitioned to the `STORAGES` settings introduced in Django 4.2 and I got `OfflineGenerationError` with `django-compressor`.
I tracked down the issue to be actually bug in `django-debug-toolbar`'s `StaticFilesPanel` which patches the static files storage and doesn't count with the new `STORAGES`. The whole issue is described here: https://github.com/jazzband/django-debug-toolbar/issues/1823

The problem itself is, that `django-debug-toolbar` is using `settings.STATICFILES_STORAGE` to get the storage class which returns `'django.contrib.staticfiles.storage.StaticFilesStorage'` even if I have `settings.STORAGES[""staticfiles""][""BACKEND""]='whitenoise.storage.CompressedManifestStaticFilesStorage'`.
Since Django 4.2 requires `STATICFILES_STORAGE` to be deleted from settings when `STORAGES` are present I don't have `STATICFILES_STORAGE` set to any particular value.

Tracking down this whole issue took me whole week and was very difficult to tackle, because it did appear in completely different place in the system (missing records in the manifest files of `django-compressor`) than the issue actually was (`StaticFilesPanel` in `django-debug-toolbar`).

I think this issue partially goes on behalf of Django itself. If Django would return `None` value or throw an exception when accessing `settings.STATICFILES_STORAGE` with `STORAGES` defined I would see the issue immediately.
The `settings.STATICFILES_STORAGE` could also return the same value as `settings.STORAGES[""staticfiles""][""BACKEND""]`, but I am bigger fun of throwing an exception, because this could lead to other kind of unexpected behavior."	Bug	closed	contrib.staticfiles	4.2	Release blocker	fixed	storages staticfiles	Jarosław Wygoda Carlton Gibson	Ready for checkin	1	0	0	0	0	0
