Flask CRUD
About Lesson

In this Flask CRUD Application lesson we are going to learn about Flask CRUD Application Inserting Data to MySQL, as we have already created our database and table, now it is time to insert some data using our frontend design.

 

 

Open your App.py file and add this code, this is for inserting data to mysql database.

 

 

 

And this is our complete code for App.py file.

 

 

 

Now open your index.html file and you need to bring changes to insert modal, add your method in the form action.

 

 

This is the complete code for index.html

 

 

 

Now run your flask application and add a new data.

Flask CRUD Application Inserting Data to MySQL
Flask CRUD Application Inserting Data to MySQL

 

 

 

If you check your WAMP Server, you can see that we have a new data.

Flask CRUD MySQL Database
Flask CRUD MySQL Database

 

 

 

templates/base.html

 

 

 

templates/header.html