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)
![Tom Drury](https://secure.gravatar.com/avatar/803acc8aa82d04c41d950f4a5621976f?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Tom Drury
10,546 PointsI got the error message: '/' gave a non-200 response. did you change the route? is this a problem with the code?
I have not changed the route, so wondering why I receive this error message. Thanks.
from flask import Flask
from flask import request
app = Flask(__name__)
@app.route('/')
def index():
name = request.args.get('name', name)
return 'Hello {}'.format(name)
2 Answers
![Ricky Catron](https://uploads.teamtreehouse.com/production/profile-photos/108204/micro_1010818_679270375218_643096572_n.jpg)
Ricky Catron
13,023 PointsI think the error is because you are passing a second argument to request.args.get(). I think it should just be:
name = request.args.get('name')
Goodluck! --Ricky
![Mike Siwik](https://secure.gravatar.com/avatar/e514dde9d23505fd92b588df245805e4?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Mike Siwik
Front End Web Development Techdegree Student 14,814 Pointsfrom flask import Flask
from flask import request
app = Flask(__name__)
@app.route('/')
def index(name="Treehouse"):
return "Hello {}".format(name)
This is 100% correct
Tom Drury
10,546 PointsTom Drury
10,546 Pointsperfect. thanks.
Chen Wang
7,371 PointsChen Wang
7,371 PointsSo why do we use
request.args.get('name', name)
in the class?
Ricky Catron
13,023 PointsRicky Catron
13,023 PointsI believe the second argument is a default which only kicks in if the request variable is empty. It would also need to be declared beforehand. AKA you can't pass in name as the second argument without name having a value EX name="Treehouse" somewhere before it is passed in.
Goodluck! --Ricky