I've seen questions like Notify panel similar to stackoverflow's. It talks about the client side of the implementation.
I'm looking for the information about the server part and the networking part (how client get notified real time)
A user scenario might look like this:
I have questions on the following steps.
seen
and unseen
? django-activity-stream doesn't have notion of them.django-push-notifications supports both Google Cloud Messaging and Firebase Cloud Messaging (which is now the officially supported messaging platform from Google).
To generate an notification anywhere in your code, simply import the notify signal and send it with your actor, recipient, and verb. The complete syntax is. Arguments: actor: An object of any type.
Inside of the “send_mail.py”, create a function that takes in the following arguments. def send_mail(html,text='Email_body',subject='Hello word',from_email='',to_emails=[]): The next step would be to make sure that the “to_emails” argument is always a “list of emails” and not a string or any other data type.
This can easily be implemented by using django-channels.Because you need websockets to have a two way client server communication.
Showing notifications is a two way communication. Server notifies the client that a new notification available. The client shows this notification to the user, and then when a user interacts with the notification, the client notifies the server that notification was read, so the next time user loads a page, only unread notifications are shown.
There are some steps involved.
django-channel
converts the application to ASGI.Now, one part is done. Your user has been notified. Coming to the second part.
I created an app that updates the client when a new message is to be shown. Github link.
You can also refer to a similar question: https://stackoverflow.com/a/55656848/4186008
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With