Post Image to Flask Webserver
Posted: Sat Nov 16, 2019 11:07 pm
Hi all,
I have sensors taking in data on my pi being saved to an sqlite3 database. I also have a flask webserver running on it. I would like to display images of historical data on the webserver and really cant find anything helpful. Below is what I am using for code and html.
app = Flask(__name__)
@app.route("/")
def index():
return render_template('live_stream.html')
if __name__ == "__main__":
app.run(host='127.0.0.1', debug=True)
<html>
<head>
<title> Live Streaming</title>
body {
text-align: center;
}
</style>
</head>
<body>
<h1> Live Streaming</h1>
<img src="url_for('static', filename='image.png'), width="80%"></img>
<h3>{{ time }}</h3>
<hr>
<h3> Return to main page ==> <a href="/"class="button">RETURN</a></h3>
<hr>
</body>
</html>
I have sensors taking in data on my pi being saved to an sqlite3 database. I also have a flask webserver running on it. I would like to display images of historical data on the webserver and really cant find anything helpful. Below is what I am using for code and html.
app = Flask(__name__)
@app.route("/")
def index():
return render_template('live_stream.html')
if __name__ == "__main__":
app.run(host='127.0.0.1', debug=True)
<html>
<head>
<title> Live Streaming</title>
body {
text-align: center;
}
</style>
</head>
<body>
<h1> Live Streaming</h1>
<img src="url_for('static', filename='image.png'), width="80%"></img>
<h3>{{ time }}</h3>
<hr>
<h3> Return to main page ==> <a href="/"class="button">RETURN</a></h3>
<hr>
</body>
</html>