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
Iris Avalon
14,477 PointsUsing render_template in challenge
I can get step one and two of this challenge complete. Oddly, however, I get an error claiming "It looks like task 2 is no longer passing".
All I've done between task 2 and 3 is add {{ name }} inside the h1 tag for the template.
Any ideas why this suddenly stopped working?
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)
<!doctype html>
<html>
<head><title>Hello!</title></head>
<body>
<h1>{{ name }}</h1>
</body>
</html>
1 Answer
Kenneth Love
Treehouse Guest TeacherYep, that was me being dumb on some validation. You should be able to pass it now with the code that you have.
EDIT: In the spirit of transparency, on step 2, to make sure you were rendering the template, I was looking for "Howdy". If you replace "Howdy" in step 3 with {{ name }}, which I don't tell you not to and you should be able to, step 2 wouldn't pass. I've taken out the check for "Howdy" and I'm checking for something else instead.