I'm trying to upgrade an existing application to use a Manifest based StaticStorage so we can leverage long-term caching.
It works as expected for files included with the `static from staticfiles` template tag: my app shows the hashed names for the standard admin javascript/css files and they all resolve correctly.
But for (admin) widgets that add extra media files using the
Media class I still get the plain (non-hash) filenames in my HTML.
I tried this with both the bundled ManifestStaticStorage as well as ManifestStaticS3Storage from
django-s3-storage.Curiously the URLs are formed differently: for example: the ones from the template tags have different URLS then the ones from Media classes:
<script type="text/javascript" src="https://s3-eu-west-1.amazonaws.com:443/my-project/static/admin/js/actions.min.2893760b9e40.js"></script>
<script type="text/javascript" src="https://s3-eu-west-1.amazonaws.com/my-project/static/js/my_custom_scipt.js"></script>
The second one corresponds with what I have set as STATIC_URL, while to first one seems to be generated by the S3 storage (it has an explicit port number). I see these non-transformed URLs for all media attached by myself or third-party widgets.
Next I looked into the source on Github, and this confirms my fear that form-media urls are simply joined to the STATIC_URL instead of passed through the staticfiles manifest mechanism.
For example:
https://github.com/django/django/blob/f59a0401e5d0e19568a038f2a50954d1a9a1526f/django/forms/widgets.py#L80-L85Doesn't this kinda defeats the purpose of using the staticfiles app and Manifest Storage if a fair part of our static files are not processed by it? Or do I miss some override or setting?
All this was using Django 1.8.6 with Python 3.4 on Ubuntu.
Any ideas what is intended here?
Bart