• This is more about the quiz itself, what is a processor variable?

    In some of the examples last time, we had

    
    render_template('file.html', processor=url_for('view_function'))
    
    
  • Can you please review how all the parts in POST-REDIRECT-GET tie in together?

    Sure. We'll walk through some examples.

  • Can you go over the why we render a blank form if method is get in the one route section?

    If the form uses POST, we don't need a way to process a filled-out form with GET. But we *always* need a way for the browser to GET a blank form. So, we can combine those in one view (handler) function; that's often convenient.

  • Is the one-route concept essentially allowing both get & post with the same template?

    It allows the browser to GET an empty form and POST a filled-out form.

  • Can you explain the
    {% if msg %}
    <p>{{msg}}</p>
    {% endif %}
    
    in example_form_processing_one_route.py?

    Sure. This adds a paragraph to the page with "msg" if "msg" was supplied by the render_template function.

  • Why does refreshing cause re-submission? I thought for most (if not all) forms, there is some type of submit button? Also the browser tries to prevent resubmission because the data is already cached so it doesn't want to "do it again"?

    refreshing re-sends the last request. If that last request was a POST...

  • What do you mean when you say the base template in the starter code has two placeholders? I assume page_title is one placeholder, because the value of message is assigned when base.html is rendered. Is the messages variable another placeholder, even though the value of the messages variable is assigned inside the html file?

    Good question. Let's look at it: base.html

    We'll search for "{{"

  • Not a question, but I wanted to add that I also find these readings that run through chunks of code to be very helpful. I also think the recorded demo of it working would be helpful if possible.

    Glad you liked it!

  • Is app.config['TRAP_BAD_REQUEST_ERRORS'] generalizable to code outside of the Wellesley CS server? Can you review what a website looks like with and without it?

    Yes, it's part of Flask. No, I can't easily demo it, but I appreciate the question.