参考:
https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#json-script
afely outputs a Python object as JSON, wrapped in a <script> tag, ready for use with JavaScript. Argument: The optional HTML “id” of the <script> tag. For example: {{ value|json_script:"hello-data" }} If value is the dictionary {'hello': 'world'}, the output will be: <script id="hello-data" type="application/json">{"hello": "world"}</script> The resulting data can be accessed in JavaScript like this: const value = JSON.parse(document.getElementById('hello-data').textContent); XSS attacks are mitigated by escaping the characters “<”, “>” and “&”. For example if value is {'hello': 'world</script>&'}, the output is: <script id="hello-data" type="application/json">{"hello": "world\\u003C/script\\u003E\\u0026amp;"}</script>
- template django data form vuetemplate django data form form-data form-data jmeter form data request httpmessageconverter form-data suitable multipart form-data supported boundary httpclient multipart form-data接口 multipart form-data属性 文件 multipart form-data只有 参数 content-type form-data multipart接口 multipart form-data类型post