title: How to receive a list in jQuery from Django(Python)
body: <p>I'm send a list from Django(Python) to jQuery, but it is throwing some error while receiving it?</p>
  
  <p>Here is what I send in python.</p>
  
  <pre><code>hubcode_list = ['a','b']
  ctx = {'form':form, 'hubcode_list' : hubcode_list, 'admin_permission' : admin_permission}
  return render(request, 'dummy/config.html', ctx)
  </code></pre>
  
  <p>jQuery:-</p>
  
  <pre><code>var hubcode_list = {{ hubcode_list }}
  </code></pre>
  
  <p>It returns an error saying :-</p>
  
  <pre><code>SyntaxError: syntax error
  var hubcode_list = [&amp;#39;a&amp;#39;, &amp;#39;b&amp;#39;]
  </code></pre>
  
  <p>When I use <code>escapejs</code> as </p>
  
  <pre><code>var hubcode_list = {{ hubcode_list|escapejs }}
  </code></pre>
  
  <p>it throws </p>
  
  <pre><code>SyntaxError: illegal character
  var hubcode_list = [\u0027a\u0027, \u0027b\u0027]
  </code></pre>
  
  <p>How do I receive a list from server(Python)? I need to implement an autocomplete functionality where I need to pass a list of tags.</p>
  
  <pre><code>$( ".hubcode_list" ).autocomplete({
          source: hubcode_list
      });
  </code></pre>