I am working on a Django / Python website. I have a page where I want to display a table of search results. The list of results is passed in to the template as normal.
How about a filter that dumps a Python value to JSON? Here's a sample implementation:
http://djangosnippets.org/snippets/201/
Since a JSON value also happens to be a valid right-hand side for a Javascript assignment, you can simply put something like...
var results = {{results|jsonify}};
inside your script.