Python Flask{{request.script|u root | tojson | safe}}不返回任何内容

Python Flask{{request.script|u root | tojson | safe}}不返回任何内容,python,flask,Python,Flask,我的Flask应用程序中没有运行js脚本,我发现根路径什么都没有。之后,我设置了一个简单的测试页面,如下所示: @app.route('/test') def index2(): return render_template('test.html') test.html: {{ request.script_root|tojson|safe }} {{ request.script_root|tojson|safe }} 它只是打印: "" 怎么了?脚本的根目录不是空的吗

我的Flask应用程序中没有运行js脚本,我发现根路径什么都没有。之后,我设置了一个简单的测试页面,如下所示:

@app.route('/test')
def index2():
        return render_template('test.html')
test.html:

{{ request.script_root|tojson|safe }}
{{ request.script_root|tojson|safe }}
它只是打印:

""

怎么了?

脚本的根目录不是空的吗,因为您直接在该服务器的根目录上

发件人:

你知道你的申请在哪里吗?如果您正在开发 答案很简单:它直接在本地主机端口上 在该服务器的根目录上

test.html:

{{ request.script_root|tojson|safe }}
{{ request.script_root|tojson|safe }}
呈现:

"http://localhost:5000/"

预期产量是多少?