文章来源:http://blog.csdn.net/lxstar01/article/details/12779715两个格式要转换的话,最好就是找个中间格式JSONpython字典如下[python] view plaincopyprint?dict = { 'param_1':1, 'param_2':2 } 在渲染模版的时候对字典操作[python] view plaincopyprint?Json.dumps(dict) 在javascript中,利用Jquery的jQuery.parseJSON[javascript] view plaincopyprint?var dict = jQuery.parseJSON('{{ dict|safe }}'); 这样就可以分理js和python的数据混淆了