I need a django application to embed a chat javascript in admin site

33 views
Skip to first unread message

Ariel Isaac Romero Cartaya

unread,
May 23, 2012, 10:37:42 AM5/23/12
to django users
Hi everybody,

I need a django application to embed a chat javascript in the admin app of my web site, I would like when the users are authenticated be able to contact by chat any other user authenticated in the admin site.

How could I do this ???
Is there an application to make this ???

Regards,
Ariel

francescortiz

unread,
May 25, 2012, 2:12:36 AM5/25/12
to django...@googlegroups.com
Implementing a simple global chat is pretty straightforward:

1- Don't use database
2- Implement filesystem based locking (multithread safe)
3- if there user wrote a new line, acquire lock and append the new line to the file.
4- releaase lock
5- send the last lines to the users. I recommend you to make a system call to "tail -n ??? [filename]", but you can implement you own last lines reading algorithm, much harder than it appears because you have stay friendly with kernel's readahead and disk cache.

You can have your chat log file in any format that fits you, (html, json, etc).

Then, for user based chat, just make the chatlog named after [user1]-[user2].chatlog, having user1 and user2 sorted alfabetically.

The hardest part is all the html an javascript needed, specially in multiuser chat, because you have to handle list of users and window opening.

jmolmo

unread,
May 25, 2012, 3:48:04 AM5/25/12
to django...@googlegroups.com
I solve that using OpenFire ( An XMPP Server with chat , multiuser-chat, etc ..) and Strophe (a javascript library for the browser).

Good luck Ariel
Reply all
Reply to author
Forward
0 new messages