问题
can any body suggest me an idea about how can i create a chat interface between the friend list which i have created for my application.
actually a want to create a chat server. i have a friends list in my django model. if more then one person is online at the same time then they chat with one another. for this purpose do i have to create a socket or is there any other way to do it.
Thanks
回答1:
There are a couple pluggable apps for using Django as a chat server that you could use or at least use as a reference or starting point.
- django-chat: http://code.google.com/p/django-chat/
- django-jqchat: http://code.google.com/p/django-jqchat/
There are also these posts on using Django with Orbited to create a chat server.
- http://ajaxian.com/archives/django-and-comet
- http://darkporter.com/blog_files/4.django_orbited.html
回答2:
A basic messaging service is fairly easy. Most of it will be through Javascript/AJAX. Simply store messages from users to users in the database, and have your AJAX poll the server for updates. Once the conversation is ended, delete them.
来源:https://stackoverflow.com/questions/2698909/django-web-server-chat