10

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.

Community
  • 1
  • 1
abel
  • 2,377
  • 9
  • 39
  • 62
  • 1
    Regarding Django templates, they're extremely simple. You don't have to learn all of Django to use them, and they are in fact simpler (and less expressive) than most templating languages. – Nick Johnson Jan 24 '11 at 02:20
  • @Nick My reaction might have been premature. – abel Jan 24 '11 at 08:04

3 Answers3

19

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.

systempuntoout
  • 71,966
  • 47
  • 171
  • 241
  • 2
    Detailed answer. Wish I could upvote more! Will there be difficulty in moving a tipfy based app from appengine to a non-appengine environment, especially db queries? Thank you for the links and info! – abel Jan 21 '11 at 18:13
  • 1
    @abel thanks, I think it will because it's a framework specifically made for GAE. If you are looking for something more flexible especially for db queries, have a look to web2py. – systempuntoout Jan 21 '11 at 19:24
4

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
Community
  • 1
  • 1
Matthew Rankin
  • 457,139
  • 39
  • 126
  • 163
3

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.

Rafe Kettler
  • 75,757
  • 21
  • 156
  • 151