I use flask framework and with this code i get the last insert data,but i want to display continuously the last insert. When i reboot the flask framework i get it.Any help?
app.py
@app.route("/sensor" , methods=['POST','GET'])
def sensor():
cursor = db.cursor()
cursor.execute("SELECT Id,temperature,humidity FROM Bseonsor WHERE Id=(SELECT MAX(Id) FROM Bseonsor)")
results = cursor.fetchall()
return render_template('sensor.html',results=results)
sensor.html
<div>
<table border="1" cellpadding="5" cellspacing="5">
{% for row in results %}
<tr> {{ row[1] }} {{ row[2] }} </tr>
{% endfor %}
</table>
</div>