Django do not auto escape characters
I have a code to play video in a django app
<video controls autoplay id='vid' muted >
<source src="{% static 'vids/videoplayback.mp4#t=10,30' %}" type="video/mp4">
</video>
The problem is that django auto escapes the characters and gives an error
GET http://127.0.0.1:8000/static/vids/videoplayback.mp4%23t%3D10%2C30 404 (Not Found)
How do I prevent this from happening?
The static
will urlencode the string, so this is not a fragment, but a hash sign (#
) as part of the file name. If you want to set a fragment, you do that after the {% static … %}
template tag [Django-doc]:
<source src="{% static 'vids/videoplayback.mp4' %}#t=10,30" type="video/mp4">