Search code examples
djangosignalschannel

Django channels or Signals?


Channels or signals for user notification.

Im currently working on creating this online booking django app. I was quite new on django and im wondering what should i use to notify certain users that a new booking has been made. The user will be notified once he/she already logged-in. Do i use channels or signals?


Solution

  • You can use both. You can create a web socket using Django channels for a duplex communication between the client and the server. You should then create a signal to listen to a new booking created event.

    Every time a new booking is created, the signal will get trigerred and send the data via the web socket to the client.