Django, Pinax and chat

162 views
Skip to first unread message

Ivan Uemlianin

unread,
Jul 2, 2009, 6:55:59 AM7/2/09
to Pinax Users
Dear All

[I have posted this also to django-users. I apologise for cross-
posting. I've done this as readership on the two groups seems to be
different.]

I am looking into using or developing a chat application for Django,
for use in a social networking website based on the Pinax Django
"distribution".

I have searched for django-based chat applications and found very
little. Below I list briefly what I've found. Please could anyone
let me know if I've missed any significant projects.

There seem to be two very different kinds of technology being used in
these projects. Some of the projects (eg django-chat) use the "same
old" approach of repeatedly polling the server at regular intervals
that lightweight chat apps in other languages use; some of the
projects use the comet approach (eg with orbited).

Is it worth using/developing a chat app using the old-fashioned
approach? Is comet better for all circumstances?

My instinct is to try and get django-chat on its feet: stable and
documented. If it turns out that approach is not up to my needs, I'll
turn to something using comet.

Projects I've found:

* django-chat
http://code.google.com/p/django-chat/
little documentation, but seems to work (with a strange intermittent
bug)

* evserver
http://code.google.com/p/evserver/
http://popcnt.org/2008/01/django-evserver-asynchronous-server-for.html
http://popcnt.org/2007/12/asynchronous-django-responses-comet-yes.html
evserver is

* Various projects based on Orbited
http://orbited.org/
- Orbited tutorials (http://orbited.org/wiki/Tutorials/)
- willowchat (http://willowchat.org/)
- Django, Comet and IRC client (http://www.rkblog.rk.edu.pl/w/p/
django-comet-and-irc-client/)
includes a simple chat application:
http://evserver.googlecode.com/svn/trunk/evserver/examples/django_chat/

* django-jchat
http://code.google.com/p/django-jchat/
description, no documentation

* djangochat
http://github.com/dmm/djangochat/tree/master
"Django-based jabber client app"
no documentation

Thanks and best wishes

Ivan

Ivan Uemlianin

unread,
Jul 2, 2009, 7:01:53 AM7/2/09
to Pinax Users
ps

I should acknowledge the previous useful discussion on this:
- <a href="http://groups.google.com/group/pinax-users/browse_thread/
thread/cbc54abcfbc69af4">gmail/facebook-style chat, comet, xmpp ...
polling, anything?</a>

Ivan

Skylar Saveland

unread,
Jul 3, 2009, 1:35:21 AM7/3/09
to pinax...@googlegroups.com
I'm pretty interested in this right now:

http://code.google.com/p/evserver/wiki/Documentation

It's the first thing that I looked at though :+_

__skyl__

Skylar Saveland

unread,
Jul 5, 2009, 8:19:41 PM7/5/09
to Pinax Users
> http://code.google.com/p/evserver/wiki/Documentation

People keep poo-pooing the idea of WSGI as an AJAX-push server and I
have to admit the idea does seem a little exotic. Anyone else making
progress in arguing themselves into a position on pinax-chat issue?

Right now, I am thinking about making a facebook-style root url using
the notifications framework so that the the user gets a livefeed of
activity on the front page and making all of the pages poll for
activity with jQuery and live-update if anyone else posts anything.
This might be a lot of overhead and not be scalable but I was
basically going to have jquery fetch the bits of the pages with .load
() and insert them into the DOM every 3-5 seconds or so and see how
rough that is on my little slice.

For chat, I'm still leaning toward some sort of twisted/orbited
combination... the wsgi-push seems like a good experiment but I don't
know if I will have the time to give it a good try right now.

Jim Robert

unread,
Jul 6, 2009, 8:44:58 AM7/6/09
to pinax...@googlegroups.com
I've used wsgi as an ajax-push server with lighter loads (only hits every 5 seconds for the first min or so) and it handles it alright as long as you keep the ServerLimit pretty high in your apache conf. if you don't have enough RAM on your slice to do that, you'll probably start having concurrency issues.

The next thing you need to worry about in that scenario is how long 'pages' (ajax content) actually take to be created. If you can slim these down by 5% or 10% on those pages that get loaded every 5 seconds, it can make a huge difference in server load :)

Jim

Federico Cáceres

unread,
Jul 22, 2009, 1:03:56 AM7/22/09
to Pinax Users
Hi Ivan,

(I'm sorry if this sounds like post hijacking! it is not my intention,
I just want to "broaden" the options spectrum)
I have recently uploaded the code of my django-jchat app into the
google code repository... I was just parking the site for a while,
that's why you probably saw nothing, sorry for the hassles. Here's the
site again: http://code.google.com/p/django-jchat/

In any case, this is a plain and simple implementation, quering the
server every N seconds for each client. I would definetively like to
change the implementation to AJAX PUSH in a future version to lessen
the server load...

But I still think that dedicated services (comet or a XMPP server for
instance... which I know has a multi-user chat extension) are far more
optimal.


Enjoy your programming!

On 6 jul, 08:44, Jim Robert <jim.mixt...@gmail.com> wrote:
> I've used wsgi as an ajax-push server with lighter loads (only hits every 5
> seconds for the first min or so) and it handles it alright as long as you
> keep the ServerLimit pretty high in your apache conf. if you don't have
> enough RAM on your slice to do that, you'll probably start having
> concurrency issues.
>
> The next thing you need to worry about in that scenario is how long 'pages'
> (ajax content) actually take to be created. If you can slim these down by 5%
> or 10% on those pages that get loaded every 5 seconds, it can make a huge
> difference in server load :)
>
> Jim
>
> On Sun, Jul 5, 2009 at 8:19 PM, Skylar Saveland
> <skylar.savel...@gmail.com>wrote:

Skylar Saveland

unread,
Jul 22, 2009, 2:46:32 AM7/22/09
to pinax...@googlegroups.com
(I'm sorry if this sounds like post hijacking! it is not my intention,
I just want to "broaden" the options spectrum)

Not at all, thank you for the link and the thought.

Ivan Uemlianin

unread,
Sep 8, 2009, 8:41:13 AM9/8/09
to pinax...@googlegroups.com
Dear Federico

Thanks for posting! My turn to apologise for taking so long to reply.

I've tried out your code and it works for me. (might be a good idea to
supply a couple of test users. I logged on twice as superuser --- once
on Firefox and once on Safari --- to try it out). I'll move on to
embedding it in a test site (maybe as a pinax page).

I agree with you about ajax push, comet, xmpp, and the rest. For me
it's 'one step at a time'.

Best

Ivan

Federico Cáceres wrote:
> Hi Ivan,
>
> (I'm sorry if this sounds like post hijacking! it is not my intention,
> I just want to "broaden" the options spectrum)
> I have recently uploaded the code of my django-jchat app into the
> google code repository... I was just parking the site for a while,
> that's why you probably saw nothing, sorry for the hassles. Here's the
> site again: http://code.google.com/p/django-jchat/
>
> In any case, this is a plain and simple implementation, quering the
> server every N seconds for each client. I would definetively like to
> change the implementation to AJAX PUSH in a future version to lessen
> the server load...
>
> But I still think that dedicated services (comet or a XMPP server for
> instance... which I know has a multi-user chat extension) are far more
> optimal.
>
>
> Enjoy your programming!

--
============================================================
Ivan A. Uemlianin
Speech Technology Research and Development

iv...@llaisdy.com
www.llaisdy.com
llaisdy.wordpress.com
www.linkedin.com/in/ivanuemlianin

"Froh, froh! Wie seine Sonnen, seine Sonnen fliegen"
(Schiller, Beethoven)
============================================================

Reply all
Reply to author
Forward
0 new messages