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. But 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 can see the different tables in the database (as shown in Figure 7.1):
You can see the tables of the models we have created – that is, movie
and news
. There are other tables, such as django_session
, because of the different apps that are installed for functions such as sessions and authentications.
Select a table – for example, news_news
, and you can see its rows (Figure 7.2).
Note
The table name is derived from <appname>_<modelname>...