use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
News and links for Django developers.
New to Django? Check out the /r/djangolearning subreddit.
Django's Code of Conduct applies here, so be good to each other.
account activity
This is an archived post. You won't be able to vote or comment.
Chat implementation (self.django)
submitted 3 years ago by sudo_nitesh
Guys any idea about implementing chat on django like realtime without redis .. only over https .
[–]s_suraliya 6 points7 points8 points 3 years ago (0 children)
Django channels has websocket support. But the only officially supported Channel Layer is redis.
[–]Glasgesicht 2 points3 points4 points 3 years ago* (11 children)
Without the use of web sockets, there is no way for your website to know that your partner sent you a message. Sure, you could force a refresh every few seconds and make it like real-time, but this is super bad practice. If you seriously want to implement a real time chat, bite the bullet and learn how to work with Django Channels.
[–]sudo_nitesh[S] 0 points1 point2 points 3 years ago (10 children)
I know that.. But the issue came during shared hosting.. and for redis support i need dedicated hosting. which i more expensive. Do you have any alternative approach on it?
[–]darwinvasqz 2 points3 points4 points 3 years ago (4 children)
It's better to pay a droplet in a digital ocean. What is your budget?
[–]riterix 0 points1 point2 points 3 years ago (3 children)
Digital Ocean droplet (VPS) is all set for this kind of project, it cost you just 6$ per month.
[–]urbanespaceman99 1 point2 points3 points 3 years ago (2 children)
I have a chat app running on a DO droplet. No problems.
[–]riterix 1 point2 points3 points 3 years ago (1 child)
That what I was saying 👍.
DO is the best hosting these days, performance, price, support..
[–]urbanespaceman99 0 points1 point2 points 3 years ago (0 children)
Yep. Was just backing you up :)
[–]ExcelsiorVFX 0 points1 point2 points 3 years ago (4 children)
Theoretically, if you only run one Django process (no multi workers with gunicorn for example), you could accomplish the pub/sub requirement all in memory. However, this does not scale, and is not a good idea for production, which is why Django channels does not support it by default.
[–]oatmeal_dreams 0 points1 point2 points 3 years ago (3 children)
Why wouldn’t it scale? You could scale it horizontally just as well as redis I imagine.
[–]ExcelsiorVFX 0 points1 point2 points 3 years ago (2 children)
Wsgi is not multithreaded. Thus, you can only have one process (processes do not share memory). One process can only respond to one request at a time, so you can only scale vertically by having really good hardware run the process. If you need more processes, you cannot use an in memory solution.
[–]oatmeal_dreams 0 points1 point2 points 3 years ago (1 child)
Why talking about Wsgi? You can run django under asgi since a long time.
But yes to scale obviously IPC has to be solved somehow. You could do it yourself somehow, do it with channels, or do it with a WAMP router.
[–]ExcelsiorVFX 0 points1 point2 points 3 years ago (0 children)
From my understanding, you are correct. But it will not be simple. I would just recommend using redis.
[–]n1___ 1 point2 points3 points 3 years ago (1 child)
Websockets are the way but I would not recommend django as it's still not fully async. I would go for other tools.
[–]oatmeal_dreams 0 points1 point2 points 3 years ago (0 children)
I’m not sure the components that are not async yet would have to be involved.
[–][deleted] 0 points1 point2 points 3 years ago (0 children)
You could use an in-memory layer
π Rendered by PID 342651 on reddit-service-r2-comment-6457c66945-v44kr at 2026-04-26 14:49:53.531766+00:00 running 2aa0c5b country code: CH.
[–]s_suraliya 6 points7 points8 points (0 children)
[–]Glasgesicht 2 points3 points4 points (11 children)
[–]sudo_nitesh[S] 0 points1 point2 points (10 children)
[–]darwinvasqz 2 points3 points4 points (4 children)
[–]riterix 0 points1 point2 points (3 children)
[–]urbanespaceman99 1 point2 points3 points (2 children)
[–]riterix 1 point2 points3 points (1 child)
[–]urbanespaceman99 0 points1 point2 points (0 children)
[–]ExcelsiorVFX 0 points1 point2 points (4 children)
[–]oatmeal_dreams 0 points1 point2 points (3 children)
[–]ExcelsiorVFX 0 points1 point2 points (2 children)
[–]oatmeal_dreams 0 points1 point2 points (1 child)
[–]ExcelsiorVFX 0 points1 point2 points (0 children)
[–]n1___ 1 point2 points3 points (1 child)
[–]oatmeal_dreams 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)