title: Passing Python Data to JavaScript via Django
body: <p>I'm using Django and Apache to serve webpages.  My JavaScript code currently includes a data object with values to be displayed in various HTML widgets based on the user's selection from a menu of choices.  I want to derive these data from a Python dictionary.  I think I know how to embed the JavaScript code in the HTML, but how do I embed the data object in that script (on the fly) so the script's functions can use it?</p>
  
  <p>Put another way, I want to create a JavaScript object or array from a Python dictionary, then insert that object into the JavaScript code, and then insert that JavaScript code into the HTML.</p>
  
  <p>I suppose this structure (e.g., data embedded in variables in the JavaScript code) is suboptimal, but as a newbie I don't know the alternatives.  I've seen write-ups of Django serialization functions, but these don't help me until I can get the data into my JavaScript code in the first place.</p>
  
  <p>I'm not (yet) using a JavaScript library like jQuery.</p>