---
title: "Discussion on \"Building Chat APIs with Django rest framework and Django Channels\" | Hashnode"
description: "Discussion on \"Building Chat APIs with Django rest framework and Django Channels\". NOTE: The code for this article can be found  here. \nIntroduction\nDjango Channels\nAccording to the documentation:\n\nChannels is a project that takes Django and extends its abilities beyond HTTP - to handle WebSockets, chat protocols, IoT protocols, an..."
url: "https://hashnode.com/posts/building-chat-apis-with-django-rest-framework-and-django-channels/612b7bf1fd0bf8636d76d78e"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Building Chat APIs with Django rest framework and Django Channels](https://bdvade.hashnode.dev/building-chat-apis-with-django-rest-framework-and-django-channels?utm_source=hashnode&utm_medium=feed)

NOTE: The code for this article can be found here. Introduction Django Channels According to the documentation: Channels is a project that takes Django and extends its abilities beyond HTTP - to handle WebSockets, chat protocols, IoT protocols, an...

Aug 29, 2021 · 13 min read · bdvade.hashnode.dev  
Read the article

-   [#django](https://hashnode.com/tag/django)
-   [#rest-api](https://hashnode.com/tag/rest-api)
-   [#websockets](https://hashnode.com/tag/websockets)
-   [#chat](https://hashnode.com/tag/chat)
-   [#python](https://hashnode.com/tag/python)

## Written by

[Victor Aderibigbe](https://hashnode.com/@BdVade)

@BdVade

  
[View profile](https://hashnode.com/@BdVade)

Python Developer, I love to see things work.

## Responses 4

Markdown supported · ⌘↵ to post

[Roman Poroshin](https://hashnode.com/@makeiteasy)

[Sep 24, 2024](https://hashnode.com/posts/building-chat-apis-with-django-rest-framework-and-django-channels/612b7bf1fd0bf8636d76d78e/comment/66f2757feb3c145b1ad301b7)

Hey there, thanks for the article! I have one issue with that, why do the messages end up duplicated with different sender IDs: one with the actual sender and the other is with the participant?

[Roman Poroshin](https://hashnode.com/@makeiteasy)

[Sep 24, 2024](https://hashnode.com/posts/building-chat-apis-with-django-rest-framework-and-django-channels/612b7bf1fd0bf8636d76d78e/comment/66f2757feb3c145b1ad301b7#reply-66f2d27871092318dc86524b)

Ok, I figured this out, there's an error in the code. The message creation code should belong in the `receive` method rather than `chat_message`. Otherwise the same message is created for each chat participant with the sender always being the recipient. Took me some time to figure this out, hope it helps someone else.

[Victor Aderibigbe](https://hashnode.com/@BdVade)

[Apr 22, 2025](https://hashnode.com/posts/building-chat-apis-with-django-rest-framework-and-django-channels/612b7bf1fd0bf8636d76d78e/comment/66f2757feb3c145b1ad301b7#reply-6807c9d777712cefc6b5dfcc)

Thank you! I've not been here in a while so I missed your comment. I'll see what I can do to clean it up. [Roman Poroshin](https://hashnode.com/@makeiteasy)

[nagarjuna u](https://hashnode.com/@nagarjuna334)

[Jun 3, 2022](https://hashnode.com/posts/building-chat-apis-with-django-rest-framework-and-django-channels/612b7bf1fd0bf8636d76d78e/comment/62997584a5004f19f574df9c)

Hiredis was not installed what we do

[Victor Aderibigbe](https://hashnode.com/@BdVade)

[Jul 27, 2022](https://hashnode.com/posts/building-chat-apis-with-django-rest-framework-and-django-channels/612b7bf1fd0bf8636d76d78e/comment/62997584a5004f19f574df9c#reply-62e16f44d15a9fb24e51441e)

Hi, You'd need to install Redis if you still have this issue.

[redis.com/blog/redis-on-windows-10](https://redis.com/blog/redis-on-windows-10/)

[linuxtechlab.com/how-install-redis-server-linux](https://linuxtechlab.com/how-install-redis-server-linux/)

[redis.io/docs/getting-started/installation/instal…](https://redis.io/docs/getting-started/installation/install-redis-on-mac-os/)

One of those should work depending on what you're working on.

[OLUWATOMISIN AYODABO](https://hashnode.com/@kingtomi)

[Aug 29, 2021](https://hashnode.com/posts/building-chat-apis-with-django-rest-framework-and-django-channels/612b7bf1fd0bf8636d76d78e/comment/612baa2efd0bf8636d76de02)

Victor vade, a very great article you made here. A whole chat app in 13 minutes, my mentor.

[Oluwatobiloba Emmanuel](https://hashnode.com/@Teepy)

[Aug 29, 2021](https://hashnode.com/posts/building-chat-apis-with-django-rest-framework-and-django-channels/612b7bf1fd0bf8636d76d78e/comment/612b880cfd0bf8636d76d958)

Nice Article😊❤️
