How can I return the value of a variable to an HTML template using FileResponse?
It's python code snippet
Code: Select all
@server.route("/")
def home(request: Request):
Version = '0.0.1' # this value i want to recieve in HTML (index.html page)
return FileResponse(request, "index.html", "/static")
Code: Select all
<title>Smart Aquarium {Version}</title>
I used Flask before and everything was clear there. Like that.
Code: Select all
@app.route("/login", methods=['POST', 'GET'])
def login():
some code
return render_template('login.html', version=version)