templates 폴더를 생성 후 안에 index.html 파일을 아래와 같이 작성
templates/index.html<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ title }}</title>
</head>
<body>
<h1>{{ title }}</h1>
<h2> Hello!!</h2>
</body>
</html>
test.pyfrom flask import Flask, render_template
app = Flask(__name__)
@app.route("/")
def index():
title = "OpenAI API Agent School"
return render_template('index.html', title=title)
if __name__ == "__main__":
app.run(host="0.0.0.0")