阅读背景:

Flask与Webapp2 (GAE)的区别

来源:互联网 

I am still collecting information but it seems that i can't figure out what the difference of those two frameworks are.

我仍然在收集信息,但是我似乎不知道这两个框架有什么不同。

Currently I am using webapp2 with jinja2 and wtforms. It comes right out of the box in GAE and works fine.

目前我正在使用webapp2与jinja2和wtforms。它直接从GAE中取出,并且工作良好。

If i compare flask and webapp2 i can only see that flask has jinja and wtforms already integrated, so no big deal there.

如果我比较flask和webapp2,我只能看到flask有jinja和wtforms已经集成,所以没什么大不了的。

If i compare the two docs it seems that both frameworks have much in common

如果我比较这两个文档,就会发现这两个框架有很多共同之处

https://webapp-improved.appspot.com/

https://webapp-improved.appspot.com/

https://flask.pocoo.org/docs/

https://flask.pocoo.org/docs/

Just have some start problems with flask to get in running locally on my windows machine.

在我的windows机器上运行flask的启动问题。

At least the docu of flask seems to be very nice. It's really nice written and very clear.

至少烧瓶的味道还不错。写得很好,很清楚。

I already searched around the web and i could not find any information about the differences.

我已经在网上搜索了一遍,没有找到任何关于差异的信息。

Flask vs webapp2 for Google App Engine

Flask vs webapp2 for谷歌App Engine

So , what are the differences ?

那么,有什么区别呢?

2 个解决方案

#1


7  

Flask abstracts a bit more away than webapp2 does. It's (optionally) function-based, so you don't need to make handler classes for everything. The decorator syntax used for route handling is a bit more succinct. All in all, though, they're equally powerful and anything you can do in one you can do in the other. If you already know webapp2, there's no reason I can think of to start using Flask.

Flask抽象比webapp2要远一些。它(可选地)基于函数,所以您不需要为所有的东西创建处理程序类。用于路由处理的decorator语法更为简洁。总而言之,它们同样强大,你可以在其中做任何事,你也可以在另一个中做任何事。如果你已经知道webapp2,我没有理由开始使用Flask。

#2


2  

I am all in on webapp2, hosting my apps for years on GAE. However if you long term plans include moving away from GAE to Google Compute Engine or Container Engine, or to AWS EC2, you might consider Flask. Thought webapp2 provides some support for out-of-GAE, it is still more specific to GAE, at least that is my feeling.

我都在webapp2上,在GAE上托管我的应用已经很多年了。但是,如果您的长期计划包括从GAE迁移到谷歌计算引擎或容器引擎,或者迁移到AWS EC2,您可以考虑Flask。虽然webapp2提供了一些对GAE外的支持,但它仍然是GAE的特定部分,至少这是我的感觉。

I myself do consider moving away from GAE, so Django and Flask are on my radar to evaluate. From what I gather Flask is lightweight (as is webapp2) and both use Jinja2 templates, so I shall start with Flask.

我自己也考虑过离开GAE,所以Django和Flask在我的雷达上进行评估。从我收集到的Flask是轻量级的(就像webapp2一样),并且都使用Jinja2模板,所以我将从Flask开始。


分享到: