-2

What is the meaning of this line("app = Flask(name)") in the below code?

I am aware that name is a special variable that gets as value the string "main" when we are executing the script. Please tell me why we are passing name here in "app = Flask(name)"?

from flask import Flask
app = Flask(__name__)
@app.route('/')
def home():
   return "Hey there!"
if __name__ == '__main__':
    app.run(debug=True)
Aayush
  • 129
  • 2
  • 8

1 Answers1

-1

Flask is a class datatype, or in simpler words, it is used to create instances of web applications. The name part is a variable that gets the string main. The lines would be called in the following order: line 1 (the import) then defining app, then just work your way down the line like that Also, check this website out for more information.

https://pythonhow.com/how-a-flask-app-works/

Pyscripter
  • 11
  • 4