title: Django: Variables inside static tag
body: <p>The question <a href="https://stackoverflow.com/questions/16655851/django-1-5-how-to-use-variables-inside-static-tag">here</a> seems to be very similar to mine; however, I tried what was suggested there but it did not work in my case so perhaps my question is different after all.</p>
  
  <p>In my html file (in the <code>&lt;script&gt;&lt;/script&gt;</code> for the Javascript section), I have:</p>
  
  <pre><code>var snd = new Audio("{% static 'updateMap/cual_es_su_nombre.mp3' %}");
  snd.play();
  </code></pre>
  
  <p>which plays the mp3 just fine; however, I would like to be able to replace the file name: <code>cual_es_su_nombre.mp3</code> with a variable. I am getting the file name(s) from the server.</p>
  
  <p>So, the first thing that I do is to load the file names into a Javascript array:</p>
  
  <pre><code>var all_file_names = new Array();
  {% for item in all_file_names_from_server %}
      all_file_names.push("{{ item |safe }}");
  {% endfor %}
  </code></pre>
  
  <p>Then, ultimately, I would like to be able to do this for example:</p>
  
  <pre><code>var snd = new Audio("{% static 'updateMap/'|add:all_file_names[0] %}");
  snd.play();
  </code></pre>
  
  <p>However, that does not work...</p>