Question 6
Consider the following Python code given below.
(Concept: Flask and concepts of HTTP methods)
from flask import Flask, request, url_for
app = Flask(__name__)
@app.route('/dashboard')def dashboard(): return 'This is the dashboard'
@app.route('/user/<username>')def user(username): return f'This is {username} profile'
@app.route('/login', methods=['GET', 'POST'])def login(): if request.method == 'POST': return(url_for('user', username='your_name')) else: return (url_for('dashboard'))
if __name__ == '__main__': app.run(debug=True)If the above flask application is running on URL “http://127.0.0.1:5000”, which of the following is the correct output if a user visits the URL “http://127.0.0.1:5000/login”, using a browser?