Complete the code to import the Flask class.
from flask import [1]
The Flask class is imported from the flask module to create the app.
Complete the code to create a Flask app instance.
app = [1](__name__)We create the Flask app by calling Flask with the current module name.
Fix the error in the route decorator to handle POST requests.
@app.route('/login', methods=[[1]])
The login form should accept POST requests to submit data securely.
Fill both blanks to get the username from the form and check if it matches 'admin'.
username = request.form.get([1]) if username == [2]:
We get the 'username' field from the form and compare it to the string 'admin'.
Fill all three blanks to return a welcome message with the username if login is successful.
if username == 'admin' and password == 'secret': return f"Welcome, [1]!" else: return [2]('login.html', [3]=True)
We show a welcome message with the username, and if login fails, render the login page with an error flag.
