#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:
- Create a project with two apps which write the same static file.
- Run
python manage.py collectstatic
. - Uninstall the first app.
- 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)
Change History (8)
comment:1 by , 10 years ago
comment:2 by , 10 years ago
Component: | contrib.staticfiles → Documentation |
---|---|
Easy pickings: | set |
Triage Stage: | Unreviewed → Accepted |
Type: | Bug → Cleanup/optimization |
comment:3 by , 9 years ago
Has patch: | set |
---|---|
Owner: | changed from | to
Status: | new → assigned |
First contribution, I followed the contribution documentation.
I ran make spelling & make html, made the diff out of git diff.
comment:4 by , 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.
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.