Answers for "flask html file"

0

how to return an html file in flask

from flask import Flask, render_template

app = Flask(__name__)
@app.route("/")
def index():
    return render_template('index.html') # You have to save the html files
                                         # inside of a 'templates' folder.
    
app.run(debug=True)
Posted by: Guest on September-29-2021
3

flask example

from flask import Flask
app = Flask(__name__)

@app.route('/')
def hello_world():
    return 'Hello, World!'
Posted by: Guest on June-11-2020

Python Answers by Framework

Browse Popular Code Answers by Language