2

I am looking for a simple python web framework which runs both as standalone and on Appengine.

I would like to write the app in such a way that i can switch between standalone and Appengine based on the deployment configuration. Standalone will be using RDBMS.

When i checked web.py looked simple and promising. I have the following questions:

  • Does web.py work well on Appengine?
  • Is there any major known gotchas?
  • Can you share your experience with using web.py on Appengine?
  • Any suggestions to achieve the above mentioned goal is appreciated.
18bytes
  • 5,951
  • 7
  • 42
  • 69

4 Answers4

4

Does web.py work well on Appengine?

Yes it does work pretty well, it's compact and very easy to use.

Is there any major known gotchas?

Web.py does not offer any Data Abstraction Layer compatible with GAE; that means that in order to switch from a RDBMS to a NoSQL database, you have to create by yourself a layer above both the web.db database API and the Google App Engine datastore API.

Can you share your experience with using web.py on Appengine?

I have deployed a couple of simple applications with web.py on top of GAE and other several pet projects with Sqlite as database; here a mini review.

Any suggestions to achieve the above mentioned goal is appreciated.

If the switch from Appengine to RDBMS is your primary concern, have a look to web2py.
Although with some limitations, to the best of my knowledge is the only one Python web framework GAE friendly that offers a DAL above the App Engine Datastore and other several RDBMS solutions.
Switching from one db to another is just a matter of initializing the DAL with the proper connection string:

db = DAL('sqlite://storage.db')
db = DAL('mysql://username:password@localhost/test')
db = DAL('gae')
Community
  • 1
  • 1
systempuntoout
  • 71,966
  • 47
  • 171
  • 241
  • it appears that web2py is the solutoin to my problem. As i understand same code can be deploy both on GAE and my server outseide GAE. – 18bytes Aug 05 '11 at 11:35
3

No webapp framework on its own is going to be able to do this - the App Engine environment consists of a lot more than just a database interface and a CGI environment. Even if it could, any DAL that supports both the datastore and a relational DB is likely to sacrifice most of the flexibility of both in pursuit of that.

Your best option, if you want to take advantage of more than just the datastore, is to write your app for App Engine, and use AppScale or TyphoonAE to run your app outside the App Engine environment.

Nick Johnson
  • 100,655
  • 16
  • 128
  • 198
  • @systempuntoout Webapp can be made to work outside App Engine just fine. But App Engine also consists of the task queue, the images API, the Users API, Cron support, and so on and so forth. Unless he's _only_ using the datastore, which seems unlikely, porting requires more than just a DAL. – Nick Johnson Aug 08 '11 at 09:23
  • oh, that's right and I agree with you. I've suggested web2py because OP asked for something usable outside gae without hassle from a database point of view; obviously it can work just for applications with a trivial database design. – systempuntoout Aug 08 '11 at 09:34
  • FYI, webapp2 works outside of App Engine and it is fully compatible with webapp. – moraes Aug 09 '11 at 14:20
  • @moraes I know - it's tangential to the point I was trying to make, though. – Nick Johnson Aug 10 '11 at 00:05
  • @Nick Johnson, sorry, that was a note directed at systempuntoout's question. – moraes Aug 10 '11 at 02:28
  • @moraes thanks I'm aware of it, this is why I would suggest webapp2 and not webapp in this case. – systempuntoout Aug 10 '11 at 06:40
1

Consider using webapp2. It is similar to web.py, provides basically the same featureset, and runs outside of App Engine out-of-the-box. Besides, you get stellar compatibility with App Engine SDK and libraries (I explain it better here).

You'd only need to add a relational database library. But this is an easy choice: SQLAlqchemy is pretty much the standard in Python land, with lots of documentation and a thriving community.

Community
  • 1
  • 1
moraes
  • 13,213
  • 7
  • 45
  • 59
0

I would also suggest web2py. Great framework, great community, plays out-of-the-box outside of AppEngine. It also supports a lot of databases (SQLite, PostgreSQL, MySQL, MSSQL, FireBird, Oracle, IBM DB2, Informix, Ingres, and Google App Engine).

On top of that, it's trivial to install it on Linux, Windows, Mac.

Jon Romero
  • 4,062
  • 6
  • 36
  • 34
  • I checked the source code of web.py-0.37 (db.py), ibm db2 is not supported. Do you mean the sqlalchemy support in webpy? – felix021 Jul 01 '13 at 08:10