1.

Is Flask An Mvc Model And If Yes Give An Example Showing Mvc Pattern For Your Application?

Answer»

Basically, FLASK is a minimalistic FRAMEWORK which behaves same as MVC framework. So MVC is a perfect fit for Flask, and the pattern for MVC .

we will consider for the following example:

from flask import Flask
app = Flask(_name_)
@app.route(“/”)
Def hello():
return “Hello World”
app.run(debug = True)
In this code your, Configuration PART will be from flask import Flask

app = Flask(_name_)
View part will be
@app.route(“/”)
Def hello():
return “Hello World”
While you model or MAIN part will be app.run(debug = True)

Basically, Flask is a minimalistic framework which behaves same as MVC framework. So MVC is a perfect fit for Flask, and the pattern for MVC .

we will consider for the following example:

from flask import Flask
app = Flask(_name_)
@app.route(“/”)
Def hello():
return “Hello World”
app.run(debug = True)
In this code your, Configuration part will be from flask import Flask

app = Flask(_name_)
View part will be
@app.route(“/”)
Def hello():
return “Hello World”
While you model or main part will be app.run(debug = True)



Discussion

No Comment Found