Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Python Flask Basics Welcome to Flask Request args

michael ernst
michael ernst
2,219 Points

Just trying to figure out where I went wrong.....I've rewatched the video several times. Where am I going wrong?

I feel as if I have written the same code as in the video. I definitely miss the hint button in this course. But I must be missing something somewhere because it's not coming up a pass. Anybody able to steer me in the right direction on what I must not be seeing?

from flask import Flask
from flask import request

app = Flask(__name__)

def index(name="Treehouse"):
    return "Hello from {}".format(name) 

1 Answer

Rick Gleitz
Rick Gleitz
45,706 Points

The title of the challenge is Request Args, and it had you import requests (which you did). So you need to use request and args in a line before the return statement:

    name = request.args.get("name", name)

You also need to return the string the challenge wants: "Hello {}" versus "Hello from {}" (that would work in real life, but it won't pass the challenge). Hope this helps!

michael ernst
michael ernst
2,219 Points

thanks! ill try it out and see how it goes