title: How do I pass string parameters from django to javascript function?
body: <p>I have a problem calling a function with string parameters obtained from python.<br></p>
  
  <p>python_var <strong>-></strong> html calls the function of js with parameters obtained from python context <strong>-></strong> js file <br></p>
  
  <p>Browser console says: Uncaught ReferenceError
  <br>
  I am using Django template language to get the variable which is defined as a string in python.</p>
  
  <blockquote>
    <p>foo.html</p>
    
    <pre class="lang-py prettyprint-override"><code>&lt;script&gt;
   libcharts_predict_k( {{title|safe}}, {{data|safe}})
  &lt;/script&gt;
  </code></pre>
  </blockquote>
  
  <p>I am sure the problem is only with Strings in JS function parameters because with arrays and numbers I didn't have any problem.<br>
  Browser tries to reference something but I am giving as a value<br></p>
  
  <blockquote>
    <p>view.py</p>
    
    <pre class="lang-py prettyprint-override"><code>def second_view(request):
      title = "A long title"
      data= df['value'].values.tolist()
      context = {
                 'data': data,
                 'title': title
                 }
  return (request, 'app/foo.html', context=context)
  </code></pre>
    
    <p>*(Imports are fine)</p>
  </blockquote>