---
title: "Comment by Roman Poroshin on \"Building Chat APIs with Django rest framework and Django Channels\" | Hashnode"
description: "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 t"
url: "https://hashnode.com/posts/building-chat-apis-with-django-rest-framework-and-django-channels/612b7bf1fd0bf8636d76d78e/comment/66f2757feb3c145b1ad301b7"
---

[Discussion](https://hashnode.com/posts/building-chat-apis-with-django-rest-framework-and-django-channels/612b7bf1fd0bf8636d76d78e)

Comment [Building Chat APIs with Django rest framework and Django Channels](https://hashnode.com/posts/building-chat-apis-with-django-rest-framework-and-django-channels/612b7bf1fd0bf8636d76d78e)

[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)
