The static directory is a strange place for it, since it is not itself a
static file, nor does it have anything to do with serving static files.
What it is is a configuration file that affects what Django inserts into
dynamically-generated pages. It has more in common with `settings.py` than
a static file.
Now, that hardly matters in a traditional deployment where static files
are served from the same machine as Django; it's just one directory versus
another. However, this approach has some serious drawbacks in the common
deployment scenario of hosting the static files separately (from S3, for
example).
One problem is that Django has to fetch a remote file as part of its
startup. That has a performance penalty, places limits on the server, and
adds an additional point of failure. More seriously, it can actually break
your site during deployment. Fundamentally this is because the generated
mapping is correct only for the commit that produced it, but it's being
uploaded to a global location where it affects the behavior of all extant
servers. So any servers that are running (or restarted) between the time
`collectstatic` is run and when the new code is fully rolled out can
behave incorrectly.
For an example of this problem in the field, see
[https://devblog.kogan.com/blog/a-hidden-gem-in-
django-1-7-manifeststaticfilesstorage this blog post]. As noted there,
it's possible to change the manifest location by supplying your own custom
storage backend. My suggestion would be to change this in Django itself,
though, since I don't see the advantage of the current behavior.
--
Ticket URL: <https://code.djangoproject.com/ticket/28764>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Comment (by Kevin Christopher Henry):
Related: #27541.
--
Ticket URL: <https://code.djangoproject.com/ticket/28764#comment:1>
* type: Uncategorized => Cleanup/optimization
Comment:
Duplicate of #27590?
--
Ticket URL: <https://code.djangoproject.com/ticket/28764#comment:2>
Comment (by Kevin Christopher Henry):
Interesting, I didn't see that one. I'll add a comment over there...
--
Ticket URL: <https://code.djangoproject.com/ticket/28764#comment:3>
* status: new => closed
* resolution: => duplicate
--
Ticket URL: <https://code.djangoproject.com/ticket/28764#comment:4>