In django, I can render a html template from a view action like this:
return render_to_response( video_handle/view.html , { filename : filename,
frame_count : frame_count, folder : folder})
这将使“观点.html”模板成为可能,使我能够查阅模板内的变数文档名称、框架_对面和夹,这样就能够很好地做到:
<script type="text/javascript">
file_name = {{filename}}
frame_count = {{frame_count}}
folder = {{folder}}
</script>
Now, when i try the same in a coffescrip file, compile the file to javascript and load it to my view.html template, the values of python s variables are not assigned to javascript variables and instead, these variables keep the string value meaning that form example file_name variable keeps the value of this string {{filename}} instead of the actual value of the python s variable called filename.
任何关于发生什么和如何解决这一问题的想法?