[英]Tornado, Django, and push notifications
I've searched Stack overflow and all I can find is how to use Tornado as a HTTP server. 我搜索了Stack溢出,我所能找到的是如何使用Tornado作为HTTP服务器。
Now, my question is how do I start doing push notifications using the system? 现在,我的问题是如何开始使用系统进行推送通知?
Let me give you some context... 让我给你一些背景......
I have a database on some server far away that I know nothing about, other than its a postgreSQL database and a piece of software on that server updates the database every so often ( maybe every couple of seconds, to couple of days). 我在远处的某个服务器上有一个我不知道的数据库,除了它的postgreSQL数据库和该服务器上的一个软件经常更新数据库(可能每隔几秒,几天)。
I Have a django app that displays these database rows. 我有一个显示这些数据库行的django应用程序。 it gets these database rows from a different app - an app called api - using an ajax call every 5 seconds.
它从一个不同的应用程序 - 一个名为api的应用程序 - 每隔5秒使用一次ajax调用获取这些数据库行。 As we all know this method is wasteful.
众所周知,这种方法很浪费。
Well I'll bullet point it: 好吧,我会指出它:
Hopefully thats not too vague. 希望那不是太模糊。
Thanks, 谢谢,
Andy. 安迪。
I found that the django-websocket-redis package suits my needs which are very much comparable to yours as it can easily be implemented on top of your existing project. 我发现django-websocket-redis软件包适合我的需求,与您的需求非常相似,因为它可以很容易地在现有项目之上实现。
Mind that there are a few dependencies (UWGSI and Redis, primarily) and I've had to switch to a Linux development environment to get everything to work properly. 请注意,有一些依赖项(主要是UWGSI和Redis),我不得不切换到Linux开发环境,以使一切正常工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.