webapp 和 web.py 之间的区别

发布于 2024-10-13 09:04:43 字数 1469 浏览 6 评论 0 原文

Webpy.org - 谁使用 web.py?

“[web.py 启发了] Web 框架 我们在 FriendFeed [和] 网络应用程序中使用 App 附带的框架 发动机...”
— 布雷特·泰勒, FriendFeed 联合创始人兼原创者 Google App Engine 技术主管

Google App Engine Python 入门

代码中嵌入的 HTML 很混乱并且 难以维护。最好是 使用模板系统... ...为您 方便,webapp 模块 包括 Django 的模板引擎

问题:
webapp 和 webpy 有什么区别?
当 Appengine 已经提供 webapp 时,还值得麻烦地捆绑 webpy 吗?

我所知道的:
1. Web.py有自己的模板语言(看起来比Django的更简单)
2. 目前,我考虑使用 web.py 的唯一原因是避免使用(和学习)Django 在 appengine 上进行模板化。
3.本问题开头的引言
4. 我曾经 通过 相关 问题以及网络应用文档在 Google 上。
5. 我注意到 stackprinter 使用 web.py 并托管在 appengine 上。

Webpy.org - Who uses web.py?

"[web.py inspired the] web framework
we use at FriendFeed [and] the webapp
framework that ships with App
Engine..."
— Brett Taylor,
co-founder of FriendFeed and original
tech lead on Google App Engine

Google App Engine Getting Started for Python

HTML embedded in code is messy and
difficult to maintain. It's better to
use a templating system... ...For your
convenience, the webapp module
includes Django's templating engine

Questions:
What are the differences between webapp and webpy?
Is it worth the trouble to bundle webpy when Appengine already offers webapp?

What I know:
1. Web.py has a templating language of it's own(it looks easier than Django's)
2. Currently, the only reason for which I am thinking about using web.py is to avoid using(and learning) Django for templating on appengine.
3. The quotes at the head of this question
4. I have been through related questions and through the webapp documentation on Google.
5. I have noticed that stackprinter uses web.py and is hosted on appengine.

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

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

发布评论

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

评论(3

隔纱相望 2024-10-20 09:04:44

webapp 和 web.py 之间的差异

主要差异(恕我直言)是:

  1. webapp 框架是专门为 Google App Engine (GAE) 设计的。 web.py 框架并不是专门为 GAE 设计的。
    • “webapp 框架是[在 Google App Engine 中]构建 Web 应用程序的默认工具集,但不是唯一的工具集。” (来源:使用 Google App Engine 进行开发 作者:Eugene Ciurana )
  2. 它们使用不同的模板语言——web.py 使用自己的模板语言,而 webapp 的模板语言基于 Django。

适用于 GAE 的其他 Python 框架

适用于 GAE 的其他 Python 框架(均不使用 Django 模板语言)包括:

  1. Flask — “基于 Werkzeug、Jinja 2 和良好意图的 Python 微框架。”
  2. tipfy — “一个专门为 Google App Engine 制作的小而强大的框架。它很像 webapp,但是提供了 webapp 所缺少的一系列功能和好处:i18n、会话、自己的身份验证、Flash 消息等等,一切都以模块化、轻量级的方式进行,并针对 App Engine 进行了调整。”

当 Appengine 已经提供 webapp 时,还值得麻烦地捆绑 webpy 吗?

就我个人而言,我认为使用 webapp 之外的其他东西是值得的。但是,我倾向于 Flask小费

Alex Martelli 在对 SO 问题的回答中认可 tipfy Google App Engine - 安全 Cookie。 Alex 的回答对我来说的主要收获是 tipfy 是:

  1. 设计用于与 GAE
  2. 轻量级
  3. 包含内置您经常需要的功能

Differences between webapp and web.py

The primary differences (IMHO) are that:

  1. The webapp framework was designed specifically for Google App Engine (GAE). The web.py framework was not designed specifically for GAE.
    • "The webapp Framework is the default tool set for building web applications [in Google App Engine] but not the only one." (Source: Developing with Google App Engine by Eugene Ciurana)
  2. They use different templating languages—web.py uses its own, whereas webapp's templating language is based on Django.

Other Python frameworks for GAE

Other Python frameworks for GAE—neither of which use the Django templating language—include:

  1. Flask — "A microframework for Python based on Werkzeug, Jinja 2 and good intentions."
  2. tipfy — "A small but powerful framework made specifically for Google App Engine. It is a lot like webapp, but offers a bunch of features and goodies that webapp misses: i18n, sessions, own authentication, flash messages and more. Everything in a modular, lightweight way, tuned for App Engine."

Is it worth the trouble to bundle webpy when Appengine already offers webapp?

Personally, I think that it is worthwhile to use something besides webapp. However, I would lean toward Flask or tipfy.

Alex Martelli endorses tipfy in his answer to the SO question Google App Engine - Secure Cookies. The main takeaway for me from Alex's answer is that tipfy is:

  1. Designed to work with GAE
  2. Lightweight
  3. Contains built-in functionality that you often want
べ繥欢鉨o。 2024-10-20 09:04:44

它们非常相似,只是 webapp 比 web.py 更适合 GAE。 webapp 非常小,并且绝对针对 App Engine 编写进行了优化,因此如果您喜欢的话,就应该使用它。你确实说过你不想使用 Django 的模板系统(我不知道为什么,这很简单),这是 webapp 默认自带的。模板系统可以更改,但我建议您尝试一下 Django 引擎。

也就是说,如果您不喜欢它,那么设置一个新框架并不难(基本上任何符合 WSGI 的框架都应该可以工作)。如果您想使用 web.py,请务必对其进行设置,但您可能需要进行一些搜索以了解如何设置它并配置所有内容才能正常工作。

They're very similar, it just happens that webapp is more tailored to GAE than web.py. webapp is very small and is definitely optimized for writing for App Engine, so if that's your cup of tea, you should use it. You did say you didn't want to use Django's template system (I don't know why, it's pretty easy), which is what webapp comes with by default. The template system can be changed, but I recommend you give the Django engine a try.

That said, if you don't like it it's not terribly hard to set up with a new framework (basically anything WSGI compliant ought to work). If you want to use web.py, by all means, set it up, but you may have to do a little searching on how to set it up and configure everything to work.

风柔一江水 2024-10-20 09:04:43

web.py 体验
三年前我开始使用 web.py,当时我决定学习一些Python Web 框架
我喜欢 web.py 的第一件事是它的简单性;我正在寻找一个基本的微框架,而不需要您在其他更大的项目中找到的所有电池,例如 DjangoWeb2py

因此,我开发了几个项目(使用 fastcgi 部署)并学习了所有 web.py 库功能Templetor 包括在内。

然后我发现了 Google App Engine 并开始使用 Webapp;这是一个无聊的过程,因为它不是使用 python(如 Templetor 或 Mako),而是迫使您学习一种新的模板语法,默认情况下它是非常严格的。
在开发 StackPrinter 时,我发现 Web.py 支持 Google App Engine,因此我删除了 Sqlite,一些小的调整并开始使用 GAE 数据存储。

Web.py 是我对 Python Web 框架的初恋,公平地说,我谈论它有点偏见。
我在 GAE 上的宠物项目中坚持使用 web.py,因为我对它很熟悉,并且 Templetor 是 快如闪电
我喜欢使用 Python 进行模板化,以及在全局范围内共享一些数据或函数到视图的简单方法,我也喜欢 用于编码、降价等的实用程序

Webapp 与 web.py
我认为比较它们是不公平的,因为 Webapp 是一个简单的框架,只提供了最基本的简单工具来入门;缺少许多功能,例如 I18n、验证、处理器 甚至基本的 cookie 处理。
检查 Webapp-improved 以获得更好的功能。

我的建议
如果您的重点主要是针对 Google App Engine 进行开发,我建议您使用一些专门为 GAE 制作的框架,例如 Tipfy.
如果您正在寻找一个可以在业余项目中使用的 Pythonic Web 框架,那么 web.py 是一个值得学习的好项目。
关注

web.py experience:
I started to use web.py three years ago when I decided to learn some Python web frameworks.
The first thing I loved of web.py was its simplicity; I was searching for an essential microframework without all the batteries that you can find in other bigger projects like Django or Web2py for example.

So I developed a couple of projects (deployed with fastcgi) and learned all of the web.py library features, Templetor included.

Then I discovered Google App Engine and started to use Webapp; it was a boring process because instead of using python (like Templetor or Mako), it forces you to learn a new templating syntax that it is very restrictive by default.
While Developing StackPrinter I found that Google App Engine was supported by web.py so I removed Sqlite, made some minor tweaks and started to use GAE datastore.

Web.py was my first love in term of Python web frameworks and it's fair to say that I'm a little biased to talk about it.
I'm sticking with web.py for my pet-project on GAE because I'm fluent with it and templetor is lightning fast.
I like the fact that I can use Python for templating and the easy way to share some data or functions globally to the views, I like also the rich toolset of utilities for encoding, markdown and so on.

Webapp vs web.py:
I think it's not fair to compare them because Webapp is a simple framework that just provides the minimum easy tools to get started; many features are missing like I18n, validation, processors or even the basic cookies handling.
Check Webapp-improved for something better.

My recommendation:
If your focus is mainly on developing for Google App Engine, I would recommend you to go with some framework made specifically for GAE like Tipfy.
If you are searching for a pythonic web framework to play with on your side-projects, web.py is a good project to study and to follow.

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