title: Creating dynamic Django Template Variables inside Javascript script tag
body: <p>This is good enough for a fixed variable we already know.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt; 
     var a = "{{someDjangoVariable}}";
  &lt;/script&gt;
  </code></pre>
  
  <p>I have one scenario, where I wanted to create the variable dynamically. 
  e.g -</p>
  
  <pre><code>&lt;script type="text/javascript"&gt; 
  for (i = 1, bar = bar , textb = ""; i &lt;= bar ; i++) 
     {
      for (j = 1, category = category , textc = ""; j &lt;= category ; j++)
       {
        var a = "{{someDjangoVariable + i + j}}";
        // Do some more stuff here in UI - create input field dynamically
       }
     }
  &lt;/script&gt;
  </code></pre>
  
  <p>In my query dict lets say i have this structure (2 * 2 matrix structure) - <code>{'someDjangoVariable11' : 1, 'someDjangoVariable12' : 23, 'someDjangoVariable21': 256, 'someDjangoVariable22': 31}</code></p>
  
  <p>Please suggest if there is a way to create variables dynamically.</p>
  
  <p>P.S - The columns and rows of matrix may vary as per <strong>User Input</strong>. It can be <code>2 *3</code>, <code>4 * 3</code>, <code>1 * 5</code> etc.</p>