使用 django 的聊天应用程序

发布于 2024-08-18 00:41:18 字数 82 浏览 3 评论 0原文

如果我使用 django 开发一个聊天应用程序,它会存在一些性能问题吗? 我可以在 django 中进行服务器推送吗? 我也想进行 PM 和房间讨论。

If i devlop a chat application using django will it have some performance problem?
Can i do server push in django?
I want to have PM and room discussions as well.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

浪菊怪哟 2024-08-25 00:41:18

我在 Pypi 和 Github 上发布了一个 Django 应用程序,它提供了多用户网络聊天。
它基于 Gevent:在多线程环境中运行良好,但在预分叉的环境中运行不佳,例如运行超过 1 个工作线程的gunicorn。
我只是在写文档。仓库是: https://github.com/qubird/django-chatrooms

I released a Django app on Pypi and Github that provides a multi-user web chat.
It's based on Gevent: works well in multithreaded environments, but not in pre-forked ones such as gunicorn running more than 1 worker.
I'm just writing the documentation. The repo is: https://github.com/qubird/django-chatrooms

情定在深秋 2024-08-25 00:41:18

使用龙卷风怎么样?我尝试了 Tornado 的演示聊天应用程序。
Tornado 还声称其性能比 django 更好。

让我知道你的想法。

How about using tornado? I tried demo chat application of Tornado.
And also Tornado claims to have a better performance than django.

Let me know your thoughts.

倾城泪 2024-08-25 00:41:18

grono.net 有聊天和 ​​PM(尽管没有房间),并且是基于 django 构建的。性能相当不错,所以我相信你应该能够达到相同的性能。这取决于您期望有多少连接。 grono.net 相当大,它使用一些缓存和服务器分发来实现良好的性能。但这一切在 Django 上都是可行的。

grono.net has chat and PMs (although there are no rooms) and is built on django. Performance is pretty well, so I believe you should be able achieve the same performance. It depends, on how much connections you are expecting. grono.net is pretty big and it uses some caching and server distribution to perform well. But it all is doable on Django.

嘿看小鸭子会跑 2024-08-25 00:41:18

我认为对于聊天应用程序,您可以使用其他技术,例如 AMQP(RabbitMQ 等)、Comet 等。
但是,对于开发用户个人资料、PM 和其他内容,您可以使用 Django。

不要忘记性能仍然取决于服务器配置(Web 服务器软件、缓存、数据库)

I think for a chat application you can use other technologies, such as AMQP(RabbitMQ, etc), Comet, etc.
But, for develop user profile, PMs, and other you can use Django.

Do not forget that performance still depends on server configuration (web server software, cache, db)

难得心□动 2024-08-25 00:41:18

基本上 Django 不是最好的方法。

但是,如果您真的坚持使用它并且不想使用太多解决方案或/并希望保持简单,您可以尝试使用它:

http://popcnt.org/2008/01/django-evserver-asynchronous-server-for.html

这是异步 django服务器。

Basically Django is not the best way to do it.

However, if you are really stick to it and don't want to use to much solutions or/and want to keep it simple you can try with it:

http://popcnt.org/2008/01/django-evserver-asynchronous-server-for.html

Whih is asynchronous django server.

眼睛会笑 2024-08-25 00:41:18

另外 Twisted 也值得一试。我认为您描述了他们的教程场景。

Also Twisted is worth checking out. I think that you described their tutorial scenario.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文