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

Stuck on Quiz

Hey guys, I'm stuck on these two fill in the blanks. Any idea?

"Set a cookie named name to "Treehouse" resp = make_response() resp.set_cookie(___, ____ )"

and also...

How would you get all of the key & value pairs from the form?

request.___.____

Thanks!

It's this quiz - http://teamtreehouse.com/library/flask-basics/character-builder/cookies-2

3 Answers

Sorry, Kenneth, but saying "I'm not going to help you because I don't think you watched the video" is just bogus!!

"Set a cookie named name to "Treehouse" resp = makeresponse() resp.set_cookie(, __ )"

'name', "Treehouse"

Now wasn't that stupid...

The question could have read:

Set a cookie named 'name' to "Treehouse"

..........

I rewatched the video and didn't see this typed out at all.

How would you get all of the key & value pairs from the form?

request.._

request.form.items()

This is the page that finally gave me a clue: http://www.sirentuan.com/1217875/codep1/flask-python-trying-to-return-list-or-dict-to-ajax-call

..and this quiz could have had more than 4 questions so these fill-in-the-blank questions didn't have to get right!!

That's why I decided to post to this forum thread!

Kenneth Love
Kenneth Love
Treehouse Guest Teacher

I never said I wouldn't help you. I'm sorry if it came across that way.

We did, however, do both of those things in the videos. We set a cookie to hold the bear's name that we got from the form. We did it around 2:45 into the video. Just a few seconds after that, we pull all of the items out of the form. In fact, those are on the same line of code in the video.

Kenneth Love
STAFF
Kenneth Love
Treehouse Guest Teacher

We do both of those in the video. Maybe try watching those parts again?

1) How would you get to the form in the request? request.form

2) What data type is the request.form object? ImmutableMultiDict

3) To access a POSTed form in Flask, I have to import the form library from flask. FALSE