def uploaded_file(filename):
    filename = 'http://127.0.0.1:5000/uploads/' + filename
return render_template('template.html', filename=filename)

@app.route('/uploads/<filename>')
def send_file(filename):
    return send_from_directory(UPLOAD_FOLDER, filename)
How to pass uploaded image to template.html in Flask