![link tables in idatabase link tables in idatabase](https://vladmihalcea.com/wp-content/uploads/2020/07/sql-join-using.png)
You can follow How To Make a Web Application Using Flask in Python 3, if you are not familiar with these concepts, but it’s not necessary. An understanding of basic Flask concepts such as creating routes, rendering HTML templates, and connecting to an SQLite database.In this tutorial we’ll call our project directory flask_todo. A local Python 3 programming environment, follow the tutorial for your distribution in How To Install and Set Up a Local Programming Environment for Python 3 series for your local machine.Prerequisitesīefore you start following this guide, you will need: For more on how to choose the right database system read our SQLite vs MySQL vs PostgreSQL: A Comparison Of Relational Database Management Systems article. It is also great for prototyping an application before moving to a larger database such as MySQL or Postgres. We’ll use SQLite because it is portable and does not need any additional set up to work with Python. This is important to be able to have access to related data in each table. The post table is a parent table, while the comments table is a child table-a record in the parent table can reference many records in the child table. Each post can reference many comments, and each comment references a single post therefore, one post has a relationship with many comments. For example, in a blogging application, a table for storing posts can have a one-to-many relationship with a table for storing comments.
![link tables in idatabase link tables in idatabase](https://dianabirkelbach.files.wordpress.com/2022/07/image-7.png)
You will learn how to use SQLite with Flask and how one-to-many database relationships work.Ī one-to-many database relationship is a relationship between two database tables where a record in one table can reference several records in another table. In this tutorial, you will use Flask with SQLite to create a to-do application where users can create lists of to-do items. Introductionįlask is a framework for building web applications using the Python language, and SQLite is a database engine that can be used with Python to store application data. The author selected the COVID-19 Relief Fund to receive a donation as part of the Write for DOnations program.