how to return an html file in flask

Solutions on MaxInterview for how to return an html file in flask by the best coders in the world

showing results for - "how to return an html file in flask"
Kimberley
24 Apr 2020
1from flask import Flask, render_template
2
3app = Flask(__name__)
4@app.route("/")
5def index():
6    return render_template('index.html') # You have to save the html files
7                                         # inside of a 'templates' folder.
8    
9app.run(debug=True)