mardi 1 septembre 2020

Unable to render HTML file in flask

I am learning to render HTML file in flask

my code

app.py:-

from flask import Flask, render_template
app = Flask(__name__)

@app.route('/')
def home():
   return render_template('index.html')
if __name__ == '__main__':
   app.run()

index.html:-

<html>
<head>
<title>Flask render</title>
</head>
<body>
<h1>This is the Index page</h1>
</body>
</html>  

expected output:-

expected output

What i am getting:-

enter image description here




Aucun commentaire:

Enregistrer un commentaire