Build a CRUD App with SQLAlchemy - MVC (Model View Controller)

  • MVC stands for Model-View-Controller, a common pattern for architecting web applications
  • Models manage data and business logic for us. What happens inside models and database, capturing logical relationships and properties across the web app objects.
Todo.query.all()
  • Views handles display and representation logic. What the user sees (HTML, CSS, JS from the user’s perspective)
<h1>Todo App</h1>
  • Controllers: routes commands to the models and views, containing control logic. Control how commands are sent to models and views, and how models and views wound up interacting with each other.
render_template('index.html', data=data)

请添加图片描述

猜你喜欢

转载自blog.csdn.net/BSCHN123/article/details/121314126
今日推荐