Python:js代码未在flask中更新
我正在刷新浏览器…在运行之后,Python:js代码未在flask中更新,python,flask,Python,Flask,我正在刷新浏览器…在运行之后, 浏览器中的更改不受影响 from flask import Flask, send_file, render_template, send_file app = Flask(__name__) @app.route('/') def hello_world(): return send_file('templates/create_conf_view.html') if __name__ == '__main__': app.run(debu
浏览器中的更改不受影响
from flask import Flask, send_file, render_template, send_file
app = Flask(__name__)
@app.route('/')
def hello_world():
return send_file('templates/create_conf_view.html')
if __name__ == '__main__':
app.run(debug=True, use_reloader=True, host='0.0.0.0', port=1672,threaded=True)
我做错了什么?根据您的代码,您需要具有如下目录结构:
app
|_
run.py
templates/
|_create_conf_view.html
根据,渲染模板时不应传递模板
将原始文件更改为,然后查看其是否有效:
from flask import Flask, render_template
app = Flask(__name__)
@app.route('/')
def hello_world():
return render_template('create_conf_view.html')
if __name__ == '__main__':
app.run(debug=True, host='0.0.0.0', port=1672, thread=True)
还要确保在指定端口访问应用程序