Problematic code starts on line 89.
--
Ticket URL: <https://code.djangoproject.com/ticket/24243>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* owner: nobody => atleta
* needs_docs: => 0
* status: new => assigned
* needs_tests: => 0
* needs_better_patch: => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/24243#comment:1>
* status: assigned => new
* owner: atleta =>
--
Ticket URL: <https://code.djangoproject.com/ticket/24243#comment:2>
Comment (by atleta):
After looking into it, now I see that I misunderstood the word 'fragment'
in the comments and it refers to url fragments, not file name fragments
(as in partial file names). However, what I have described above is still
a valid behaviour and in line with the default
django.contrib.staticfiles.storage.StaticFilesStorage behaviour.
--
Ticket URL: <https://code.djangoproject.com/ticket/24243#comment:3>
* owner: => atleta
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/24243#comment:4>
* easy: 1 => 0
Comment:
Can you offer a patch for this issue? I'm having trouble understanding
exactly what changes you're proposing to make?
--
Ticket URL: <https://code.djangoproject.com/ticket/24243#comment:5>
* status: assigned => closed
* resolution: => needsinfo
--
Ticket URL: <https://code.djangoproject.com/ticket/24243#comment:6>
Comment (by atleta):
The change I'm suggesting is that resolving a non-existent file name
doesn't raise a ValueError when using ManifestStaticFilesStorage (change
needed in HashedFilesMixin). Though it was 5 weeks ago, it seems I have
done the fix back then.
Do I attach a file containing the suggested fix here or do I create a pull
request? (The documentation wasn't 100% clear.)
--
Ticket URL: <https://code.djangoproject.com/ticket/24243#comment:7>
Comment (by timgraham):
Pull requests are preferred. Let me know which documentation you were
confused by so we can update it.
--
Ticket URL: <https://code.djangoproject.com/ticket/24243#comment:8>
Comment (by atleta):
Pull request created. Can't remember the documentation that caused the
confusion, it was over a month ago. Will let you know if I see it again.
--
Ticket URL: <https://code.djangoproject.com/ticket/24243#comment:9>
Comment (by aaugustin):
Isn't this a duplicate of #18958?
--
Ticket URL: <https://code.djangoproject.com/ticket/24243#comment:10>
Comment (by atleta):
Nope, it isn't. What I'm doing is being able to use
{{{
{% static 'wherever/some/of/your/files/are/' %}
}}}
or e.g. (generated js)
{{{
var sound = '{% static 'sounds/mysound' %}';
}}}
and then append .mp3 or .ogg depending on the browser capabilities. Both
files are present. Actually #18958 would still be an issue for the
reporter after accepting my patch.
--
Ticket URL: <https://code.djangoproject.com/ticket/24243#comment:11>
* status: closed => new
* type: Uncategorized => New feature
* resolution: needsinfo =>
Comment:
Reopening for further consideration.
--
Ticket URL: <https://code.djangoproject.com/ticket/24243#comment:12>
Comment (by aaugustin):
With the example above, `var sound = '{% static 'sounds/mysound' %}';`
should be rendered as `var sound = '/static/sounds/mysound.e678b76a';`.
How does Django determine the hash to insert there?
--
Ticket URL: <https://code.djangoproject.com/ticket/24243#comment:13>
Comment (by atleta):
It does not. In this case, cache busting doesn't work.
--
Ticket URL: <https://code.djangoproject.com/ticket/24243#comment:14>
* needs_better_patch: 0 => 1
* has_patch: 0 => 1
* version: 1.7 => master
* stage: Unreviewed => Accepted
Comment:
I'm tentatively accepting this ticket, although I'd like to confirm with
@jezdez who authored `HashedFilesMixin`.
As far as I could tell when using it (I tested with
`CachedStaticFilesStorage`), `{% static 'foo/bar' %}` (that doesn't exist)
will only cause an error when `DEBUG=False` (without this patch). This
doesn't seem like a great behavior (errors go undetected until you're
running in production). A better behavior might be log a warning when
`DEBUG=True`. With this patch, references to missing files go undetected,
but at least won't get crashes in production for missing files.
--
Ticket URL: <https://code.djangoproject.com/ticket/24243#comment:15>
Comment (by edwardotis):
Hi all,
What happened to this bug? It's killing my deployment to production on
Heroku with DEBUG=False. Raising an uncaught ValueError in post_process
that kills collectstatic and breaks deployments is a sub optimal design
decision.
A single missing static file blocks my entire production deployment for
Django 1.7 - 1.9
I should be able to override this behavior with something like an optional
--no-strict flag on collectstatic.
The default could be strict (as it is today), and then developers like me
could make the choice to get our deployment out to production with a
missing file, instead of being completely (and surprisingly) blocked.
What are the steps to re-open this?
--
Ticket URL: <https://code.djangoproject.com/ticket/24243#comment:16>
Comment (by timgraham):
The ticket is open. It's waiting for a patch.
--
Ticket URL: <https://code.djangoproject.com/ticket/24243#comment:17>
* status: new => closed
* needs_better_patch: 1 => 0
* has_patch: 1 => 0
* resolution: => wontfix
* stage: Accepted => Unreviewed
Comment:
I don't think it's worth the potential confusion and if someone wants to
ignore the missing files they can always use a
`ManifestStaticFilesStorage` subclass (see
[https://github.com/django/django/pull/4246 David's comment]). There is no
need to add this to Django itself.
--
Ticket URL: <https://code.djangoproject.com/ticket/24243#comment:18>