django / channels

Developer-friendly asynchrony for Django
https://channels.readthedocs.io
BSD 3-Clause "New" or "Revised" License
6.06k stars 800 forks source link

best way to impliment django notification system in my app #987

Closed rahul6612 closed 6 years ago

rahul6612 commented 6 years ago

i created a app where peoples can like/unlike posts they can follow/unfollow to each other and my question is:

  1. when user A like/unlike user B posts, user B get the notification (user A liked/unliked your post)
  2. when user A follow user B, user B get the notification(user A follow you)
  3. i have no idea about it so which is the best way to implement it. Is it possible to do with django channels if yes then give some guidence ( i am new in django so please explain about it)
  4. notification should show without reloading the page

any idea

andrewgodwin commented 6 years ago

It is very possible, but unfortunately I can't give everyone detailed help about how to implement applications or I'd be here all day.

In short - make a Group for each user (groups are cheap), send messages to the group from the places in the code where these notifications happen, and then attach incoming sockets to the right groups to relay the events down to the user.