Python Flask Basics Templates and Static Files Simple Template

flat html

help

flask_app.py
from flask import Flask
from flask import render_template

app = Flask(__name__)


@app.route('/Hello/<name>')
def hello(name="Treehouse"):
     return  render_template('Hello.html', name=name)
templates/hello.html
<!doctype html>
<html>
<head><title>Hello!</title></head>
<body>
<h1>Howdy!</h1>
</body>
</html>

1 Answer

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 59,905 Points

You’re very close. “hello.html” should not be capitalized.

Post back if you need more help. Good luck!!!