0 votes
in Python by
Is flask an MVC model? If yes, justify your answer by showing an example of your application with the help of MVC pattern?

1 Answer

0 votes
by
Basically, flask is a minimalistic framework that behaves the same as MVC framework. So MVC will be perfectly suitable for the flask and we will consider the MVC pattern in the below example.

from flask import Flask                 

In this code your,

app = Flask(_name_)                      

@app.route(“/”)                                

Def hey():                                          

return “Welcome to Appmajix”     

app.run(debug = True)

The following code can be fragmented into

Configuration part will be,

In this code your,

app = Flask(_name_)

View part will be,

@app.route(“/”)                                

Def hey():                                          

return “Welcome to Appmajix”

While your main part will be,

app.run(debug = True)
...