我试图采取图像输入和做一些处理,然后在网页上显示输出。但是,当我尝试其他图像时,显示的是旧图像而不是新图像。在
以下是代码片段:
from flask import Flask, render_template, request
import pro
app = Flask(__name__)
@app.route('/')
def index():
return render_template("index.html")
@app.route('/process', methods=['GET', 'POST'])
def process():
n = '/home/vivek/Desktop/CL3/d/booth/trial/uploads/up.jpg'
a = pro.pro(n)
return render_template("out.html")
if __name__ == '__main__':
app.run(debug=True)
工艺代码:
^{pr2}$最后是HTML文件:
<!DOCTYPE html>
<html>
<body>
<h2>OUTPUT</h2>
<img src="{{url_for('static', filename='out.jpg')}}" alt="OUTPUT" style="width:128px;height:128px;">
</body>
</html>
你需要禁用缓存
更新
^{pr2}$相关问题 更多 >
编程相关推荐