Realtime solution for Django?

狂风中的少年 提交于 2019-12-23 17:25:54

问题


A few months ago I was able to use Orbited and Stomp with Django to create a simple realtime application. The Orbited project seems to be dead now (or in a state of flux?) as orbited.org is down.

What is a good current solution for creating realtime applications with Django?

Thanks.


回答1:


Very late, but short answer:

It does appear like Orbited is dead. However, you can still use it for Django (I have, recently). There are other options, like APE, but getting that to work with Django is not trivial, and it's also not greatly maintained. But APE works with Node.js, which is a good fit for this sort of thing.

In my experience, unless the Comet solution you need is exceedingly simple, and you have lots of time and freedom to set things up both on your development server and your deployment server, you're better off to go with something made to solve the problem, like Scala + Lift. (I know, you asked for Django, but after searching for a long time myself, I feel it good to leave you with this bit of advice.)




回答2:


Realtime solution for Django is Channels . Channels is a project to make Django able to handle more than just plain HTTP requests, including WebSockets and HTTP2, as well as the ability to run code after a response has been sent .

To use channels , you have to install as an external app . pip install -U channels

Github repo - https://github.com/andrewgodwin/channels .

documentation here - http://channels.readthedocs.io/en/latest/



来源:https://stackoverflow.com/questions/7465110/realtime-solution-for-django

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!