Chat application

76 vues
Accéder directement au premier message non lu

Pedro

non lue,
18 juin 2014, 18:47:4918/06/2014
à django...@googlegroups.com
Hello,

i'm working in a mobile app that depends of a Django server (to manage user data and stuff).
This mobile app is about a social network with users interacting. It should have a chat system, where two or more users can send and receive messages and photos.

I'm thinking in the best way to implement the communication and the model on the server. My first idea is to use a simple model with rooms and messages (each message belong to a room). To send messages from a client to the server, i think i could use http requests, like GETs and POSTs, where i would implement syncronization methods and stuff.

Is this the best approach to solve this problem on Django?


----------
Pedro Alves

Mestrando em Ciência da Computação
Universidade Estadual de Campinas

carlos

non lue,
18 juin 2014, 21:27:0918/06/2014
à django...@googlegroups.com
Hi, maybe not all with django, maybe you need learn gevent
 and here is example for a chat with redis and django + gevent + socketio etc.

Cheers


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CACW_pa0Dfom4Eydop5qedMMP5fbuBx-yZAUgDrhDApfewDFWbQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ilya Kazakevich

non lue,
19 juin 2014, 05:19:0019/06/2014
à django...@googlegroups.com
Hello,

You may use websockets on client and asyncio on serves as it is done here: https://github.com/throwable-one/chat-async/
But websockets require modern client and asyncio require python 3.4 (but asyncio is standard and worth using, anyway)

Ilya Kazakevich,
JetBrains PyCharm (Best Python/Django IDE)
http://www.jetbrains.com/pycharm/
"Develop with pleasure!"
><https://groups.google.com/d/msgid/django-users/CACW_pa0Dfom4Eydop5qed
>MMP5fbuBx-yZAUgDrhDApfewDFWbQ%40mail.gmail.com?utm_medium=email
>&utm_source=footer> .
> For more options, visit https://groups.google.com/d/optout.
>
>
>
>--
>You received this message because you are subscribed to the Google Groups
>"Django users" group.
>To unsubscribe from this group and stop receiving emails from it, send an email to
>django-users...@googlegroups.com.
>To post to this group, send email to django...@googlegroups.com.
>Visit this group at http://groups.google.com/group/django-users.
>To view this discussion on the web visit
>https://groups.google.com/d/msgid/django-users/CAM-7rO0052uKjqh%3D5UEt-
>%2BGo1-muj3k-Yu7%2BFKjVFLCOTLi2AA%40mail.gmail.com
><https://groups.google.com/d/msgid/django-users/CAM-7rO0052uKjqh%3D5UEt
>-%2BGo1-muj3k-Yu7%2BFKjVFLCOTLi2AA%40mail.gmail.com?utm_medium=ema
>il&utm_source=footer> .

Cal Leeming [Simplicity Media Ltd]

non lue,
19 juin 2014, 05:36:1919/06/2014
à django...@googlegroups.com
+1.

You may even be able to do this using uWSGI plugins and Redis which would be even faster.

Django is certainly not the right tool for the job for this use case though.

Cal


Anshum Verma

non lue,
19 juin 2014, 23:23:0019/06/2014
à django...@googlegroups.com

I would suggest you to use Twisted along with Django. Django could serve as MVC framework and twisted could take control of connection protocol.

--

Pedro

non lue,
27 juil. 2014, 15:27:0427/07/2014
à django...@googlegroups.com

Thank you guys.

I tried to do it using socket.io clients and django-socketio but i just can't make it works. So, now i'm using a node.js server that talks with my main django server. Clients emit messages to the node.js server, that does the authentification with a POST request to my django server. I need to do more tests but this looks to work well.

Thank you all! 

Répondre à tous
Répondre à l'auteur
Transférer
0 nouveau message