Running migrations that generate relationships
We must create the initial migration for the new models we recently coded. We just need to run the following Python scripts and we will also synchronize the database for the first time. As we learned from our previous RESTful Web Service sample, by default, Django uses an SQLite database.
In this new example, we will be working with a PostgreSQL database. However, in case you want to use an SQLite, you can skip all the next steps related to PostgreSQL, its configuration in Django, and jump to the migrations generation command. You will also have to use the SQLite utilities instead of the PostgreSQL tools to analyze the database.
We will use the PostgreSQL command-line tools to create a new database named toys
. In case you already have a PostgreSQL database with this name, make sure that you use another name in all the commands and configurations. You can perform the same tasks with any PostgreSQL GUI tool or any database administration tool that...