Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#25001 closed Cleanup/optimization (fixed)

collectstatic does not correctly handle uninstallation of apps which write the same file as remaining apps.

Reported by: Julian Andrews Owned by: aRkadeFR
Component: Documentation Version: 1.8
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

Steps to reproduce:

  1. Create a project with two apps which write the same static file.
  2. Run python manage.py collectstatic.
  3. Uninstall the first app.
  4. Re-run python manage.py collectstatic.

Expected behavior:
The file from the second (still installed) app should be installed.

Observed Behavior:
The file from the first (now uninstalled) app remains installed.

See https://github.com/fusionbox/collectstatic_bug for a demonstration of the bug.

Attachments (1)

25001.diff (1.1 KB ) - added by aRkadeFR 9 years ago.
Patch documentation for staticfiles stale content

Download all attachments as: .zip

Change History (8)

comment:1 by Tim Graham, 9 years ago

The issue is that collectstatic doesn't have any knowledge of which app a static file was collected from. It only looks at a file's modification time when determining whether to recopy a file. Unless there's an alternate proposal, I'd suggest to add a documentation warning about this and recommend the collectstatic --clear option in this case.

comment:2 by Tim Graham, 9 years ago

Component: contrib.staticfilesDocumentation
Easy pickings: set
Triage Stage: UnreviewedAccepted
Type: BugCleanup/optimization

comment:3 by aRkadeFR, 9 years ago

Has patch: set
Owner: changed from nobody to aRkadeFR
Status: newassigned

First contribution, I followed the contribution documentation.
I ran make spelling & make html, made the diff out of git diff.

by aRkadeFR, 9 years ago

Attachment: 25001.diff added

Patch documentation for staticfiles stale content

comment:4 by Tim Graham, 9 years ago

Thanks for the initial patch. For future reference, please use spaces instead of tabs for indentation. I tweaked the patch slightly in a pull request. Let me know if it's clear to you.

comment:5 by aRkadeFR, 9 years ago

seems good to me, thanks for the review.

comment:6 by Tim Graham <timograham@…>, 9 years ago

Resolution: fixed
Status: assignedclosed

In 5ae0dd6a:

Fixed #25001 -- Doc'd caveat about collectstatic and removing INSTALLED_APPS.

Thanks aRkadeFR for the initial patch.

comment:7 by Tim Graham <timograham@…>, 9 years ago

In 252867e:

[1.8.x] Fixed #25001 -- Doc'd caveat about collectstatic and removing INSTALLED_APPS.

Thanks aRkadeFR for the initial patch.

Backport of 5ae0dd6abf8f93b90c962e62b04c675fdd6ca755 from master

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