How do i cache bust with Django's staticfiles? -


i have webpage includes image. wish cache bust image using ? technique. however, staticfiles encodes questionmarks '%3f', path no longer correct.

{% load staticfiles %} <img src="{% static 'poll/img/test.jpg?v2' %}"> 

gets compiled as.

<img src="/static/poll/img/test.jpg%3fv2"> 

there no test.jpg%3fv2 file. doesn't show. using static works fine.

{% load static %} <img src="{% static 'poll/img/test.jpg?v2' %}"> 

get's compiled expected. want use staticfiles rather static serve static files cloud service. there way prevent encoding of string path or workaround of problem?

to solve encoding either write own version of static tag or move parameters beyond tag.

{% load staticfiles %} <img src="{% static 'poll/img/test.jpg' %}?v2"> 

Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -