Django WebSockets
A small Django application with support for communication via WebSocket.
Functionality:
The project is launched through an ASGI web server (not the standard runserver).
In asgi.py, support for both HTTP and WebSocket connections is configured.
A consumer is implemented that accepts connections only from authorized users and exchanges data in JSON format.
Users can group together (for example, by company affiliation or by a value selected in the frontend). Messages are sent only within the group that the user belongs to.
The project implements at least one asynchronous database request.
The ability to send notifications to all users in the group during events not directly related to WebSocket has been added. For example:
when company data is changed — all members of the company group receive updated information;
or calling a regular HTTP endpoint leads to messages being sent over the sockets.
Functionality:
The project is launched through an ASGI web server (not the standard runserver).
In asgi.py, support for both HTTP and WebSocket connections is configured.
A consumer is implemented that accepts connections only from authorized users and exchanges data in JSON format.
Users can group together (for example, by company affiliation or by a value selected in the frontend). Messages are sent only within the group that the user belongs to.
The project implements at least one asynchronous database request.
The ability to send notifications to all users in the group during events not directly related to WebSocket has been added. For example:
when company data is changed — all members of the company group receive updated information;
or calling a regular HTTP endpoint leads to messages being sent over the sockets.