选择什么网络框架

发布于 2024-11-23 14:50:32 字数 1459 浏览 2 评论 0原文

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

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

发布评论

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

评论(4

水水月牙 2024-11-30 14:50:33

对于我自己来说,Pyramid 中的 mako + sqlalchemy 是达成交易的关键。如果您喜欢一些不错的数据库工作,SqlAlchemy 是最好的选择。我也是 Mako 模板的忠实粉丝。在我的书中,能够在 mako 本身中创建可重用的演示类型函数,而不是尝试在最终尝试导入的 python 模块中执行操作,这是一个优点。

我真正想提的是,对于你的最后一个项目,你应该真正考虑通过使用消息队列和诸如 Celery 来完成工作并更多地使用 Web 应用程序来提交/结果显示,而不是实际尝试将工作从 Web 应用程序中分离出来。

For myself, mako + sqlalchemy in Pyramid are what seal the deal. If you're into some decent DB work, SqlAlchemy is just the best to work with. I'm also a big fan of the mako templates. The ability to create presentation type functions in mako itself that are reusable vs trying to do things in python modules that you end up trying to import in is a plus in my book.

What I really wanted to mention is that for your final item, you should really look at farming that stuff out to outside workers by using a message queue and something like Celery to do the work and use the web app more for submission/results display than actually trying to split the work out of your web application.

生生漫 2024-11-30 14:50:33

正如 S.Lott 在他的评论中指出的那样,您的要求并没有给出明确的“赢家”,因为至少大多数框架都具有这种能力。

在我看来,Python Web 框架在三个方面的差异更大:

  • 接近“Pythonic”的概念
  • 轻量级
  • 开销

通常较轻的框架将:需要更多开销并具有更多 Pythonic 方法(webpy、cherrypy...),而较重的框架( django、turbogear...)会让你在几分钟内启动并运行你的应用程序,但会以某种方式迫使你以某种(逻辑但不一定是Pythonic)方式塑造你的代码。

也就是说,我相信您 95% 的答案取决于个人喜好。

哈!

As pointed out by S.Lott in his comment, your requirements do not give a clear-cut "winner" as at least most of the frameworks have that capability.

Three dimensions along which which python web framework diverge more are IMO:

  • Closeness to the concept of "pythonic"
  • Lightness
  • Overhead

Typically lighter frameworks will: require more overhead and have a more pythonic approach (webpy, cherrypy...), while heavier frameworks (django, turbogear...) will let you have your app up and running in minutes but will somehow oblige you to shape your code in a certain (logical but not necessarily pythonic) way.

That said, I believe 95% of your answer relies on personal preference.

HTH!

寒尘 2024-11-30 14:50:33

除了您提到的框架之外,您绝对应该查看 web2py。我认为您会发现它是最容易设置、学习和使用的,特别是考虑到它提供的广泛功能。其一,如果它的主要目标是不“让你紧张”。它包括一个优秀的身份验证系统;集成的 Javascript/AJAX 支持(另请参阅 Javascript/AJAX 支持) com/book/default/chapter/13#Components" rel="nofollow">组件);快速而强大的数据库抽象层网络服务自动 RESTful API 生成;很棒的文档;以及非常有用且响应迅速的邮件列表。开发非常活跃,至少每个月都会发布新版本(不会破坏向后兼容性)。这是最近的演示文稿

In addition to the frameworks you have mentioned, you should definitely check out web2py. I think you'll find it among the easiest to set up, learn, and use, particularly given the breadth of functionality it offers. One if its primary goals is to not "break your nerves." It includes an excellent authentication system; integrated Javascript/AJAX support (see also components); a fast and powerful database abstraction layer; web services; automatic RESTful API generation; great documentation; and a very helpful and responsive mailing list. Development is very active, with new releases at least every month (without ever breaking backward compatibility). Here is a recent presentation.

何处潇湘 2024-11-30 14:50:33

一篇观点文章...

我喜欢 Pylons(现在被 Pyramid 取代)的特性以及 Django 框架对新举措的广泛支持(尽管不喜欢它重新发明这么多轮子的热衷 - 尤其是 MVC)。

我喜欢 Web2py 中的数据抽象层,它支持部署到 Google 的 AppEngine。这是我做出决定的一个关键因素。 Web2py 是受 RoR 启发的,有些人可能会回避它,但我很欣赏它,并且到目前为止还没有阻碍任何开发路径。

最后,在尝试了几个框架后,我使用了 Web2py(使用官方书籍作为参考)。一个响应速度非常快的优秀社区

An opinion piece...

I like the character of Pylons (now replaced by Pyramid) and the wide support of new initiatives by the Django framework (though not its keeness to reinvent so many wheels - esp. MVC).

I like the Data Abstraction Layer in Web2py that enables deployment to Google's AppEngine. This was a key feature in making my decision. Web2py is RoR inspired which some may shirk but which I've appreciated and so far hasn't blocked any development path.

In the end having tried several frameworks I've used Web2py (using the offical book as reference). A great community with very fast response.

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