user wise conversation

127 views
Skip to first unread message

Armaan Alam

unread,
Nov 21, 2023, 5:22:03 AM11/21/23
to Django users
how to chat with two user without using any room code with django channels

Migui Galan

unread,
Nov 21, 2023, 8:07:55 PM11/21/23
to django...@googlegroups.com
as far as i know, you need to have channels because this is where websockets communicate from sender-receiver vice versa

On Tue, Nov 21, 2023 at 6:22 PM Armaan Alam <armaan...@gmail.com> wrote:
how to chat with two user without using any room code with django channels

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/django-users/69b184bf-2e05-42d0-882e-0c4a81a07c3an%40googlegroups.com.

Ryan Nowakowski

unread,
Nov 22, 2023, 8:16:42 AM11/22/23
to django...@googlegroups.com
You could go old school and use HTTP polling. No channels required.

Dawda Borje Kujabi

unread,
Nov 22, 2023, 11:20:36 AM11/22/23
to django...@googlegroups.com
Don't know if this will work, 
But if you use websockets and Django channels for real time chatting and then create an app 'chat'. In the model define:

Import your user model

Receiver: foreign key of user to receive 
Sender: foreign key model of user to send
Message: text model
Time_stamp: date model

Then in views write 2 functions

1. List page for the chats based on the receiver

2. Detail page of the chats, with the messages being ordered by time stamp


Then just make your urls and make migration. 

Please tell me if this won't work. 

Basith

unread,
Nov 22, 2023, 12:24:56 PM11/22/23
to django...@googlegroups.com

Adarsh Chand ramola

unread,
Nov 24, 2023, 9:26:21 AM11/24/23
to django...@googlegroups.com

Adarsh Chand ramola

unread,
Nov 24, 2023, 9:26:22 AM11/24/23
to django...@googlegroups.com
Hello sir 

Dawda Borje Kujabi

unread,
Nov 27, 2023, 7:07:40 AM11/27/23
to django...@googlegroups.com
Yes sir, how are you doing? 
Reply all
Reply to author
Forward
0 new messages