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

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?

flask_app.py
from flask import Flask
from flask import request

app = Flask(__name__)

@app.route('/')
def index(name="Treehouse"):
    return "Hello from {}".format(name) 

1 Answer

Rick Gleitz
Rick Gleitz
47,414 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