Opened 14 months ago

Closed 14 months ago

Last modified 14 months ago

#21867 closed Cleanup/optimization (fixed)

AppStaticStorage is still using app_module.__file__

Reported by: aaugustin Owned by: carljm
Component: contrib.staticfiles Version: master
Severity: Release blocker Keywords: app-loading
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

It should perhaps be updated to use app_config.path.

Reported here: https://code.djangoproject.com/ticket/21862#comment:5

Change History (6)

comment:1 Changed 14 months ago by carljm

  • Owner changed from nobody to carljm
  • Status changed from new to assigned
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 14 months ago by carljm

  • Has patch set

Filed https://github.com/django/django/pull/2211 as a suggested fix for this.

comment:3 Changed 14 months ago by aaugustin

  • Severity changed from Normal to Release blocker

If we take the risk of breaking things, let's take it only in one release.

comment:4 Changed 14 months ago by jezdez

Yeah, I think we should tread carefully and add this to a list of APIs that could be cleaned up in a future version. Whether we can actually get rid of AppStaticStorage right away, I'm not sure. Maybe check with sourcegraph if there are many uses out there? https://sourcegraph.com/search?q=AppStaticStorage

comment:5 Changed 14 months ago by Carl Meyer <carl@…>

  • Resolution set to fixed
  • Status changed from assigned to closed

In f56c88a8eed91f68f6845bbf730f7b7361c5cfb1:

Fixed #21867 -- Removed AppStaticStorage; app paths are now AppConfig's job.

AppStaticStorage only provided one thing over FileSystemStorage, which was
taking an app name (import path) and translating it into a filesystem
path. This is now something that should be done via app_config.path instead,
leaving AppStaticStorage with no reason for existence. It should be safe to
remove, as it was undocumented internal API.

There was some kind of feature in the AppDirectoriesFinder code related to a
"prefix" attribute on the storage class used by AppDirectoriesFinder. Since
this feature was undocumented, untested, and of unclear purpose, I removed it
as well.

comment:6 Changed 14 months ago by Jannis Leidel <jannis@…>

In b9e0ea3cb4ad25f767c77cb85a05f800aefda65b:

Merge pull request #2211 from carljm/t21867

Fixed #21867 -- Removed AppStaticStorage; app paths are now AppConfig's job.

Note: See TracTickets for help on using tickets.
Back to Top