Chapter 4: Working with the Database
This chapter does not aim to teach you how to interact with a database using Django or to create migrations—I assume you already have those minimal skills. This chapter instead will show you how to work with real situations where a Channels instance interacts recurrently with models.
Unless the application is only powered by external APIs, having a database is an elementary requirement in any modern web development. The needs can range from functionality as simple as storing plain text in an orderly fashion, to an authentication system, to managing a complex structure of connections between users. In other words, you must connect to a database if you want to build a practical project.
Fortunately, Django is compatible with the most popular relational databases: PostgreSQL, MariaDB, MySQL, Oracle, and SQLite. And if that’s not enough, we can also connect to other possibilities thanks to extensions created by the community: CockroachDB...