Question 8
Consider the following Flask app code.
from flask import Flask, requestvalid_users = [ {"uid": "student", "pwd": "12345"}, {"uid": "professor", "pwd": "54321"}, {"uid": "hod", "pwd": "abcde"},]
app = Flask(__name__)
@app.route("/signin")def login(): args = request.args for vu in valid_users: if vu["uid"] == args["uid"] and vu["pwd"] == args["pwd"]: return "You are authorized!!" else: return "You are unauthorized!!"
app.run(debug=True)Assume the above flask app runs on “http://127.0.0.1:5000/” and is accessed through the web browser. What will be the output for the URL: “http://127.0.0.1:5000/signin?uid=professor&pwd=54321” ?
You are authorized!!
You are unauthorized!!
Not Found
Internal Server Error