# ...
@app.route("/htmlserve")
def htmltest():
return app.send_static_file("mypage.html")
<html>
<head>
<title>My Page</title>
</head>
<body>
<h1>Hello!</h1>
</body>
</html>
/app.py
/mypage.html
from flask import render_template
#####################################
# /!\ REMEMBER TO IMPORT THE MODULE #
# ABOVE OR IT WON'T WORK! #
#####################################
# ...
@app.route("/hello/<name>")
def say_hi(name):
# You could just return the name in a simple
# route like before like this:
# return "Hello " + name
return render_template("hello.html", name=name)
<html>
<head>
<title>My Page</title>
</head>
<body>
<h1>Hello {{name}}!</h1>
</body>
</html>
/app.py
/mypage.html