-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Building SPAs with Django and HTML Over the Wire
By :

A very popular exercise when implementing WebSockets in any technology is to create a simple Chat. However, the difficulty increases considerably when we have several connected clients who are going to talk in private spaces and open groups so that any client can read or participate. Using Channels, we are creating a solid enough abstraction so that we can focus on other issues.
Let’s create a Chat complete with modern features:
Next, we must define the database. We will define the models for users, rooms, and messages. That way, we will be able to store the actions of each user and there will be a record of everything that happens.
In this section, we are going to create some models in the database to manage customers, groups (which we will call rooms), and messages.
Edit /app/chat/models...