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
Gavin Ralston
28,770 Pointsrender_template task 2 doesn't pass if updated for task 3
Task2 requires just rendering the hello.html template, but task 3 requires passing a value and processing variable in the html form.
If you update to have it pass task 3, it fails the check for task 2
Not sure how to proceed.
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)
return render_template('hello.html')
<!doctype html>
<html>
<head><title>Hello!</title></head>
<body>
<h1>Howdy! {{ name }}</h1>
</body>
</html>
Ricky Catron
13,023 PointsChanged topic from CSS to python. I'm gonna test your issue now and hopefully get back with an answer.
--Ricky
Gavin Ralston
28,770 PointsThanks.
Wonder how I managed to get a CSS tag on it when submitting it from the task directly. (Maybe that was another one. I know I was viewing some CSS questions at some point today....)
1 Answer
Ricky Catron
13,023 PointsSorry about the wait.
You need to look at how your passing in variables, that line should be:
return render_template('hello.html', name=name)
The documentation here is a great way to troubleshoot your code.
Goodluck! --Ricky
Gavin Ralston
28,770 PointsWhy yes...yes it does need to be passed in like that :)
Just one of those moments. I was consistently doing that elsewhere, just couldn't see that I was missing it here. Appreciate the second set of eyes!
Ricky Catron
13,023 PointsGlad to help!
Gavin Ralston
28,770 PointsGavin Ralston
28,770 PointsThe commented line in the hello function is only commented because that was required to get task 2 to pass again.