Comet protocol and Django - I know some options but I can't seem to make them WORK
I'm very interested in making r开发者_如何学编程eal-time web apps with Django. Unfortunately, I'm having more than a little bit of problem with setting things up. Some options I'm considering:
Orbited: Seems to be the choice for Django. Unfortunately, their domains have seemingly expired, and with it pretty much all of the documentation I'd need to get it working. I've followed a tutorial on http://mischneider.net/?p=125 but I'm having a mysterious error (see No handlers could be found for logger "stomp.py").
Meteor: I have to say, their website impresses me. Unfortunately, I'm running Windows and there seems to be an abject lack of documentation for anything regarding Windows. So I'm lost.
Cometd: Similar problem: Just don't understand installation.
Tornado: Requires pycurl, which in turn requires curl. Keeps throwing a problem with CURL_DIR then libcurl.lib. After hours of tinkering, have effectively thrown up my hands in frustration.
Please help. I'm very willing at this point to consider, well, ANYTHING. Well, at least if it's documented to a point where I can figure out how to install it and use it with Django.
Any help appreciated.
To do real-time web apps using comet techniques (or websocket) you need a server that can handle long-lived connections and a javascript client. Most of the comet libraries give you both (APE, orbited, etc). Working with websockets seems preferable to me, it's part of HTML5, the client code is really simple to implement, etc. I'd suggest finding an asynch framework/server you like, and implementing the live/real-time part of your project with it.
Gevent has a long-polling asynch chat demo built on Django. Gevent is quite popular and well documented.
Eventlet is a nice concurrent networking library, it's pretty well documented.
Twisted is of course the de facto asynchronous networking library for Python. Here's an example of using websockets with twisted.
Meinheld is a nice lightweight asynchronous webserver, it uses greenlet and has examples of usage with Django, and with websockets.
Uwsgi has great asynchronous support, and tons and tons of features, several examples of various approaches. It has a fair bit of documentation as well.
Also check out the bottle documentation for a good primer on asynchronous applications.
Take a look at EvServer : EvServer documentation.
精彩评论