Answer the question
In order to leave comments, you need to log in
How to make site update every 10 seconds?
I made this nonsense:
@app.route("/chat")
def _chat():
with open("db/lastauthor.txt", "r") as file:
author = file.read()
with open("db/lastmsg.txt", "r") as file:
content = file.read()
return render_template("chat.html", author=author, content = content)
Answer the question
In order to leave comments, you need to log in
this is usually implemented in JavaScript (Flask will return a fresh page at any time, and the browser should force something to automatically reload the page)
https://www.w3docs.com/snippets/javascript/how-to-...
Use sockets.
They allow you to create a streaming connection between the client and the server, which in turn.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question