#16161: If extra static files are added into STATIC_ROOT, they are transformed to symlinks in the next run of ``collectstatic -l`` ------------------------------------+------------------------------------- Reporter: gnotaras | Owner: aaugustin Type: Bug | Status: new Milestone: | Component: contrib.staticfiles Version: 1.3 | Severity: Normal Resolution: | Keywords: Triage Stage: Accepted | Has patch: 0 Needs documentation: 0 | Needs tests: 0 Patch needs improvement: 0 | Easy pickings: 0 UI/UX: 0 | ------------------------------------+------------------------------------- Changes (by jezdez):
* ui_ux: => 0 Comment: Replying to [comment:16 kmtracey]: > I don't see deleting (or renaming) a file in source static trees to be at all the same thing as having added a file to the the target tree. The first is something that is a natural part of development, the 2nd is a should-not-do (unless it's done by another automated step that is always run after collectstatic). Requiring devs to remember that "oh, I deleted/renamed a static file, I need to do something special for deploy to work properly next time" is a recipe for disaster. I would have expected collectstatic to start out by deleting the old target tree, so as to ensure that what it produces correctly mirrors what is now in the source trees, with no stale leftover files. What's the rationale for NOT doing this? The rationale is simple: not having to copy/link all static files again on each run. It can take quite a while to run collectstatic on a medium to big Django site. > It seems to me it's what is needed in order to correctly support deleting/renaming source static files during development. Yes, it will blow away any files that have been somehow added into the static target tree after collectstatic finished the last time, but I see that as a should-not-do anyway, so I don't really understand why breaking things if that has been done is a bad thing. collectstatic tries to be smart about **adding** files to `STATIC_ROOT` by comparing the modification_time of the files it tries to copy/link, to be quicker, but I don't see a good way to check that a file is to be removed. E.g. how could we differ a file that is located in `STATIC_ROOT` but can't be found in one of the locations staticfiles collects files from? -- Ticket URL: <https://code.djangoproject.com/ticket/16161#comment:18> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-updates@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.