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.
发布评论
评论(3)
webapp 和 web.py 之间的差异
主要差异(恕我直言)是:
适用于 GAE 的其他 Python 框架
适用于 GAE 的其他 Python 框架(均不使用 Django 模板语言)包括:
当 Appengine 已经提供 webapp 时,还值得麻烦地捆绑 webpy 吗?
就我个人而言,我认为使用 webapp 之外的其他东西是值得的。但是,我倾向于 Flask 或 小费。
Alex Martelli 在对 SO 问题的回答中认可 tipfy Google App Engine - 安全 Cookie。 Alex 的回答对我来说的主要收获是 tipfy 是:
Differences between webapp and web.py
The primary differences (IMHO) are that:
Other Python frameworks for GAE
Other Python frameworks for GAE—neither of which use the Django templating language—include:
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:
它们非常相似,只是 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.
web.py 体验:
三年前我开始使用 web.py,当时我决定学习一些Python Web 框架。
我喜欢 web.py 的第一件事是它的简单性;我正在寻找一个基本的微框架,而不需要您在其他更大的项目中找到的所有电池,例如 Django 或 Web2py。
因此,我开发了几个项目(使用 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.