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 trialGavin Ralston
28,770 PointsError: '/' gave a non-200 response.
route in the decorator isn't changed, function name isn't changed, and this appears to fit the challenge terms.
Also having some strange behavior in workspaces, where the flask app was running but I wound up back at the command line and I can't launch it again -- it says the address is already in use. In case that's somehow related.
from flask import Flask
from flask import request
app = Flask(__name__)
@app.route('/')
@app.route('/<name>')
def index(name="Bob"):
return "Hello {}".format(name)
So if you remove the default for name in index() it responds with non-200 response. If it's set to any value for default, though, I get an unexpected response error.
Any help would be appreciated.
2 Answers
Kenneth Love
Treehouse Guest TeacherYeah, this challenge is all about the query string.
Gavin Ralston
28,770 PointsThis task is asking us to import request, so I should have been using request.args.get, not pulling the arguments from the route wrapper.
Gavin Ralston
28,770 PointsGavin Ralston
28,770 PointsOn a completely unrelated note, I'm pretty sure Tron was awesome, so you might want to update your introduction in the logging or pdb video in the Python course to reflect that, sir.
END OF LINE.
Kenneth Love
Treehouse Guest TeacherKenneth Love
Treehouse Guest TeacherTRON was awesome (actually loved both movies). He didn't "shrink down" in TRON, though, he was digitized. :D
Gavin Ralston
28,770 PointsGavin Ralston
28,770 PointsOh yeah! MCP proved that conservation of information doesn't stop even when you're converted to pure energy. So way ahead of string theory.
If it was Inner Space, though, you're dead on.