2

I'm comming from java world (apache wicket) and need to use python for my project.

I've heard about Turbogear2, Pyramid(Pylons) or Django and read some about them. My first choice will be TurboGears2 built on top of Pylons, with tools already packaged, but perhaps someone as some advice.

I do not need to create a lot of content like wikis or blog, but represent and give access to some objects in my database, and then build a javascript interface to work on this data.

What I need the web framework to to for me :

  • authentication system with roles (admin, user, group,...)
  • use of enhanced javascript tools like dojo outside the app, but it would be good if I could share components between the app and the javascript library.
  • easy AJAX : components have to be refreshed 'onChange' (I don't like submit buttons)
  • a good ORM. Don't know SQLAlchemy but it seems nice, mapping object to/from database, database pooling,....
  • easy deployment (coming from java I think it will be ok ;))
  • add easily css or js to pages
  • a framework that don't break my nerves ;)
  • a good documentation and/or good support

  • threading/multiprocess support (there are a lot of calculations. Some of them taking huge amout of memory, some other taking processing time. So I want to be able to lauch procees out of application. But I think it's more about using a python library and nothing to do with this question? )

THX

1
  • 2
    All frameworks do this. We can't offer much additional help above and beyond the work you've already done. The very, very best we can do is to toss a coin for you. Heads.
    – S.Lott
    Jul 14, 2011 at 11:01

4 Answers 4

5

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.

2
  • While I don't have anything against SqlAlchemy (which surely enjoy a large userbase), I think that saying "it's just the best to work with" is really more of a personal opinion than a fact. For one, I prefer Canonical's Storm, which doesn't do so much... alchemy! It's more transparent in its working, it's lighter, faster, and let you much more control over your DB. (I'm not claiming it's absolutely better, I'm just claiming that it's different than SqlAlchemy and - for the bulk of my work - it's a better solution than SqlAlchemy...
    – mac
    Jul 14, 2011 at 17:58
  • 1
    Definitely, but after using the Django ORM, playing with Storm since I was a bit Ubuntu canonical fan and checked out some of launchpad's codebase, I find SqlAlchemy the best to work with. It breaks down to raw sql much slower than the others which is a bit win when you're trying to write an app that's backend agnostic.
    – Rick
    Jul 14, 2011 at 19:06
1

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!

1

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.

0

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.

Not the answer you're looking for? Browse other questions tagged or ask your own question.