【发布时间】:2020-10-09 06:12:39
【问题描述】:
我有一个从提交按钮创建文件位置的应用程序
json_path = os.path.join('json', request.POST['submit'], '.json' )
这给出了\static\json\ 文件夹下的文件位置。
我正在使用字典将这个发送到模板
render_dict = {
'json_path':json_path,
}
在 javascript 中,我有以下内容
<script>
map.addSource('locationData', {
type: 'geojson',
data: "location of the json file needs to be provided here"
});
</script>
谁能建议这是否可以通过模板标记来完成?
【问题讨论】:
标签: javascript django templates tags