Ask coding questions

← Back to all posts
Help with python flask
[deleted]

I'm making a website with flask I have this python code:

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

@app.route('/')
def hello_world():
  return render_template('index.html')

And this html:

<!DOCTYPE html><html> <head> <title></title> </head> <body>
</body>
</html>

When I run it the website wont show up.

Comments
hotnewtop
MocaCDeveloper (711)

Is the .html file inside the 'templates' folder?

'static' folder is for .css files, 'templates' are for .html files.