# \[Django Channels\] Private Chat Advise

**URL:** <https://forum.djangoproject.com/t/django-channels-private-chat-advise/1224>\
**Category:** Using Django\
**Created:** [February 20, 2020, 10:46pm UTC](https://forum.djangoproject.com/t/django-channels-private-chat-advise/1224 "2020-02-20T22:46:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![HaidarZ](https://avatars.discourse-cdn.com/v4/letter/h/9de053/32.png) [@HaidarZ](https://forum.djangoproject.com/u/HaidarZ)\
**Post date:** [February 20, 2020, 10:46pm UTC](https://forum.djangoproject.com/t/django-channels-private-chat-advise/1224/1 "2020-02-20T22:46:24Z")

</div>

I’m developing a mobile application with Django as a web api.  
Recently the client requested to add private chat feature. The problem is that I don’t want to add more technologies to my stack.

My question is , can I use Django Channels for private messaging (one-to-one) and ensure reliability at the same time.

Is Django Channels taking into account private messaging and have the ability handle it smoothly.  
If the answer is positive , how can we achieve that.

Note that I’m using the latest version of Django V3

---

<div class="post-metadata">

**Author:** ![adamchainz](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/adamchainz/32/26_2.png) [@adamchainz](https://forum.djangoproject.com/u/adamchainz)\
**Post date:** [February 20, 2020, 11:15pm UTC](https://forum.djangoproject.com/t/django-channels-private-chat-advise/1224/2 "2020-02-20T23:15:57Z")

</div>

Hi Haidar,

Yes Channels can do that. The channels tutorial gives chat as an example: [https://channels.readthedocs.io/en/latest/tutorial/index.html](https://channels.readthedocs.io/en/latest/tutorial/index.html) . Although it’s chat rooms, you’d really want to use a connection per user to send them the messages DM’d to them.

To make messages reliable, you’ll want to store them in the database. This is also probably the case if you want users to be able to see past messages when they reopen the website. Websockets can then be seen as a way of speeding up delivery compared to HTTP polling.

Using Channels with Django 3.0’s ASGI handler might not be the easiest right now as Channels [isn’t on ASGI 3](https://github.com/django/channels/issues/1316) but that’s being worked on and there are workaorunds.

Hope that helps,

Adam

---

<div class="post-metadata">

**Author:** ![yandiro](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/yandiro/32/7265_2.png) [@yandiro](https://forum.djangoproject.com/u/yandiro)\
**Post date:** [January 31, 2022, 3:49am UTC](https://forum.djangoproject.com/t/django-channels-private-chat-advise/1224/3 "2022-01-31T03:49:14Z")

</div>

Instead of sending a message to a group, you can send to a channel.  
More info here: [Channel Layers — Channels 3.0.3 documentation](https://channels.readthedocs.io/en/latest/topics/channel_layers.html#synchronous-functions)
