要将变量的值传递给 Flask 的 url_for() 函数中的参数,您可以直接使用变量名称作为参数名。在您的例子中,conf 参数的值来自 let conf,可以直接使用 conf=conf 将其传递给 url_for() 函数。
例如:result.src = "{{ url_for('VRF.video_in', conf=conf, iou=iou, fname=fname) }}",这将使用 conf 变量的值作为 url_for() 函数的 conf 参数的值。如果您想要将其他变量的值传递给函数的其他参数,也可以在函数调用中添加适当的参数。
<link rel="stylesheet" href="{{url_for('static',filename='css/index.css')}}">
该条语句就是在模版中加载css静态文件.
原因:
app.url_map有static静态路由
<Rule '/static/<filename>' (HEAD, OPTIONS, GET) -> static>])