简体   繁体   English

Django - 在新的赞后向用户发送通知

[英]Django - Send notification to user after new like

I'm searching for a method to notify an user if another user liked his/her post.我正在寻找一种方法来通知用户是否有其他用户喜欢他/她的帖子。 For example instagram is giving you an alert: "this_user liked your post".例如 instagram 给你一个提醒:“this_user 喜欢你的帖子”。

Is there a way to do with djangos integrated messages framework?有没有办法处理 djangos 集成消息框架? So far I got the logic for like a post (simple post request).到目前为止,我得到了类似帖子的逻辑(简单的帖子请求)。 I want to send the notification to the author of the post so after post.save() method.我想在post.save()方法之后将通知发送给帖子的作者。

Someone know how to do?有人知道怎么办吗?

You can't use messages framework for notify, messages works in request/response cycle.您不能使用消息框架进行通知,消息在请求/响应循环中工作。 maybe onesignal is useful in your case.也许onesignal在您的情况下很有用。

onesignal-sdk is a python client library onesignal-sdk是一个 python 客户端库

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM