Understanding the database viewer
Let’s take some time to understand how the database works. The objects are stored in the db.sqlite3
file. If you click on it, it is not very readable. However, you can view such SQLite files with a SQLite Viewer; just google SQLite Viewer
for a list of them. One example is https://inloop.github.io/sqlite-viewer/.
Drag and drop your db.sqlite3
file into the previous link (over the SQLite Viewer), and you will see the different tables in the database (as shown in Figure 7.1):
Figure 7.1 – Opening db.sqlite3 in SQLite Viewer
You can see the table of the model we have created – that is, movie
. Note that the actual name of the table is determined by combining the name of the app with the name of the model. For example, if your app is named movies
and your model is named Movie
, the corresponding table name would be movies_movie
. This naming convention helps Django differentiate between tables belonging...