本文介绍了Tornado是Django的替代者还是彼此互补?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对Tornado和其他Web框架有几个疑问。

I have several questions about Tornado and other web frameworks.

1)Tornado声称自己是一个Web服务器(一个非阻塞的服务器,因此性能较高),因此有人说它没有发挥django的作用-即,他们说龙卷风不是Web框架。

1) Tornado claims to be a webserver (a non-blocking one, therefore much performant), so some people said it does not play the role of django --i.e., they say tornado is not a web framework.

但是,它确实提供了我认为的Web框架( )-在这样,它似乎已将django替换为Web开发框架。

However, it does provide a web framework I think (http://www.tornadoweb.org/documentation#main-modules) -- in this way, it seems to replace django as the web development framework.

我的上述理解正确吗?

2)通常,在Nginx后面设置几个龙卷风。 Tomcat通常也安装在Apache Web服务器之后。我能说Tornado在Tomcat中对Java Web服务器起着完全相同的作用吗?如果答案是肯定的,那么Tornado就是一个Web框架。

2) Normally, several Tornados are set up behind Nginx. Tomcat is also normally set up behind Apache web server. Can I say Tornado plays exactly same role of Tomcat does for Java web server? If the answer is yes, then Tornado IS a web framework.

3)我读了一些文章,说同时使用Tornado和Django,例如,但是我在线阅读了一些文章,声称如果使用Django,那么您将失去Tornado的异步性,这是真的还是假的?
但是,一个相关的问题是,如果Tornado本身就是我在1)中所说的Web框架,那么为什么人们根本不愿意使用Django? (以生成插件?)

3) I read some article saying using Tornado and Django together, such as http://www.jeremybowers.com/blog/post/3/on-deploying-tornado-web-server-framework/, but I read some article online claiming that "if you use Django, then you lose the asynchronous from Tornado", is this true or false?A related question though, if Tornado is itself a web framework as I said in 1), why people bother using Django at all? (to result the plugin?)

有人可以给我介绍101吗?

Can someone give me a 101 introduction?

推荐答案

要回答这个问题,


  • 不,Tornado不能替代Django。这是另一种选择。

  • NO, Tornado is not a replacement to Django. It's an alternative.

是的,它们是互补的,但不是在同一过程中(*)

YES, they are complementary to each other but not in the same process (*)

当需要大量团队合作和/或需要在SQL数据库上运行时,我会使用Django。

I would use Django when it's a big team effort and/or needs to run on a SQL database.

我会用Tornado做其他所有事情。就是个人项目,与WebSocket相关的应用程序,使用NoSQL后端的应用程序。

I would use Tornado for everything else. Ie. personal projects, WebSocket related apps, apps that use a NoSQL backend.

(*)不必在龙卷风内部或其他情况下运行django,除非您确实对此有强烈的要求。

(*) don't bother running django inside tornado or the other way around unless you really have a strong requirement for that.

这篇关于Tornado是Django的替代者还是彼此互补?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-11 11:24