Question 10
Consider the following code:
from flask import Flask, request, render_template_string
app = Flask(__name__)
@app.route('/', methods=['GET', 'POST'])def home(): if request.method == 'POST': name = request.form['name'] template = "Hello, {{ name }}!" return render_template_string(template, name=name) return ''' <form method="POST"> Enter Your Name: <input type="text" name="name"> <button>Submit</button> </form> '''
if __name__ == '__main__': app.run(debug=True)You are building a Flask web application that takes user input from an HTML form and displays it using Jinja2 templates. Suppose the user runs this app locally and submits the name Alice in the form.
Which of the following represents the correct sequence of concepts that occur when the user submits the form with the name Alice ?