Version

In order for users to get the most up today CSS and JS every time they come back to the site we need to make the names of the files dynamic. An easy way to do this is to add a argument to the end of the URL.


To do this we use the version of the current git commit to be our unique identifier.


All we need to do is add the following code to the end of the file url (out side of the static url)

 {% if version %}?version={{version}}{% endif %} 


A complete example would look like this.

 <script type="text/javascript" src="{% static "js/script.js" %}{% if version %}?version={{version}}{% endif %}"></script>