Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![michaelangelo owildeberry](https://uploads.teamtreehouse.com/production/profile-photos/2502462/micro_restore.png)
michaelangelo owildeberry
18,173 PointsPass the name argument to the template. Print the name variable in the <h1> in the template.
"Didn't find the passed-in name in the template." Please help =)
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')
return 'Hello {}'.format(name)
<!doctype html>
<html>
<head><title>Hello!</title></head>
<body>
<h1>Howdy!</h1>
</body>
</html>
5 Answers
![Kenneth Love](https://uploads.teamtreehouse.com/production/profile-photos/710512/micro_TeacherShoot-Kenneth.jpg)
Kenneth Love
Treehouse Guest TeacherYou don't have a {{ name }}
in the template and you're always hardcoding name
to the string "name"
when you render the template.
![Erion Vlada](https://uploads.teamtreehouse.com/production/profile-photos/938852/micro_photo3.php.png)
Erion Vlada
13,496 PointsThis will work, your two errors are, like Kenneth Love said, you used name = 'name'
instead of name = name
and you didn't put {{name}}
in your html template so that value is actually used.
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)
![Ruby R](https://secure.gravatar.com/avatar/4056987b1061c8888cf2674c516ed1cf?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Ruby R
1,086 PointsI got bummer - Dint find the passind-in name in the template.
Code:
from flask import Flask
from flask import render_template
app = Flask(__name__)
@app.route('/hello/<name>')
def hello(name='Treehouse'):
context={'name':name}
return render_template("hello.html", **context)
<!doctype html>
<html>
<head><title>Hello {{name}}!</title></head>
<body>
<h1>{{name}}</h1>
</body>
</html>
![Ron Fisher](https://secure.gravatar.com/avatar/d3ad06ba569a2e1cef88c443de96a668?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Ron Fisher
5,752 PointsMichaelangelo,
I haven't taken this course but the web info shows you have to have a placeholder for the incoming variable. It shows something like {{ name }}.
Ron
![michaelangelo owildeberry](https://uploads.teamtreehouse.com/production/profile-photos/2502462/micro_restore.png)
michaelangelo owildeberry
18,173 PointsRight =) I am so used to only editing one file that html escapes my grasp.