#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: nobody
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
------------------------------------+-------------------------------------
Comment (by aaugustin):
`STATIC_ROOT` is a build target. It's managed by the build system. We're
not supposed to alter it.
`collectstatic` says that it will overwrite everything inside:
{{{
You have requested to collect static files at the destination
location as specified in your settings file.
This will overwrite existing files.
Are you sure you want to do this?
Type 'yes' to continue, or 'no' to cancel:
}}}
If it must be altered, that is a step of the deployment processs that must
happen after `collectstatic`. For your example, JS / CSS minification, see
django-compressor: `compress` runs after `collectstatic`.
----
Still, it's true that the current behavior of `collectstatic -l` when
someone adds files to `STATIC_ROOT` does not make sense.
I think the most predictable behavior is to delete any file in
`STATIC_ROOT` that is not found in one of `STATICFILES_DIRS`.
If we don't do this, developers may believe that they can add stuff to
`STATIC_ROOT` ("Hey dude! It just works!"), and that creates a data-loss
problem. Suppose I add manually a "logo.png" file in `STATIC_ROOT` on the
production server, and later on, someone else creates "logo.png" in one of
STATICFILES_DIRS. During the next `collectstatic`, the version from
`STATIC_ROOT` will be overwritten silently and lost!
Short version : if it breaks (ie. a file is overwritten or deleted), it'd
better break now and loudly than at some point in the future and silently.
--
Ticket URL: <https://code.djangoproject.com/ticket/16161#comment:8>
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 [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.