views:

848

answers:

10

Suppose your boss told you to choose a Python web application framework, and you would be wedded to it for at least the next 3 years.

What would you recommend?

Ground rules:

  • Python: Yes, required. (Ruby+ not an option for reasons irrelevant. Case closed.)
  • Custom/Hybrid Setups: Sure... if they are defensible on technical grounds.
  • Upgrades: Yes. Upgrades allowed promptly, even for pre-1.0 release software.

Pylons? Django? Mako? Genshi? CherryPy? Cheetah?

A: 

I think I could probably deal with django for three years, but it's tough to say without knowing what you're really making.

f4nt
+7  A: 

Django seems to have the most traction, and is being actively development; being chosen by Google as the default template framework for App Engine certainly didn't hurt. It seems solid enough to keep you going for three years or longer.

Jason Etheridge
+8  A: 

Pylons with Mako and SQLAlchemy. All three are under active development, and Pylons is more loosely coupled than Django is, and ends up being more flexible. Django can be good for small projects, but for anything with complexity, it can be a little too constraining.

Aaron Gallagher
+1 for answering the question IE. OOP and RDBMS friendly.
Evan Plaice
+3  A: 

There's a wide variotion of web frameworks in Python. What it all comes down to is what you really, really need.

Django is one of the really widely used web framework but there's been some critique towards Django because the interdepencies of the things insinde Django are a bit hairy. I suggest you take a look at some of the talks in the DjangoCon 2008 Keynote: Cal Henderson - Why I hate Django, DjangoCon 2008 Keynote: Mark Ramm - Building a better framework - A Turbogears guy on what Django should learn from Zope. and as well some positive things about Django from DjangoCon 2008: High Performance Django, by David Cramer and Django success stories. Those talks list fairly well what is possible and what is missing from Django.

I've had pretty good experience with Django among developers for a student project it was used in. It boosted their productivity quite a bit in the beginning but then you always end up doing things in the framework specific way. That's life and you just have live with it.

Another one I suggest looking at is TurboGears. I myself don't have any experience about it but from the perspective of modularity and pluggability it looks like a good one.

So what I'm really trying to say is that you have to really look into the needs of your project and decide upon that. Probably with all of the frameworks suggested you will be able to succeed.

Bleadof
+2  A: 

If you had some time to work on the project, I would suggest paste for the WSGI wrapper, Genshi for templating ,and SQLAlchemy for the ORM. This is basically Pylons, which I would suggest if you have a deadline to work within.

alif
+3  A: 

I quite like CherryPy. It's very easy to pick up the basics and actually get something going. I found there was quite a bit of overhead getting into Pylons and Django.

As for templating I've been enjoying using Genshi recently. But there are so many templating engines out there that in the end it essentially seems to come down to your preferred syntax.

And for ORM I'd go for either SQLObject or SQLAlchemy depending on the complexity of the data model (SQLAlchemy for the more complex).

Max Stewart
+2  A: 

The only one I've used so far is Pylons, which I had thrust unwittingly upon me. Depending on preference, you could either hate it or love it. The big thing is that, at its core, it's really just a collection of smaller Python packages with some very light glue, much of which is generated as part of your app. On the one hand, this means it's easy to swap out or upgrade parts and easy to fit everything to your needs (even if they aren't what the Pylon authors intended, which is often a problem with frameworks). On the other hand, not all simple problems will have simple solutions, and some of the documentation is written from the perspective of using whichever module independently rather than as part of Pylons.

If that doesn't sound like a good idea, I'd vote for Django; my impression is that it's a solid and standard choice (so lots of resources), and at the very least I've not heard any serious complaints with using it.

Eevee
A: 

Django + Jinja2, anything else I'd do only for fun.

Vasil
A: 

I have tried different web frameworks, a couple of templating engines, a few ORMs in Python, and have to admit I am willing to join the cheer leading group for Django. IOW, I love using Django, and that is what I would highly recommend.

ayaz
+3  A: 

Pylons, Django, TurboGears, and Zope are all going to be around for the next 3 years I believe. They've all been around for at least 3+ years so far and have shown no sign of going anywhere (though I'm sure some people might wish Zope would go away).

Since they'll all be around, what you really need to do is decide which one meets your actual needs, which you didn't describe very completely. You might want to look at the other stackoverflow thread on Django vs Pylons for more details on that comparison rather than rehashing it.

TurboGears2 is a bit fresh, but is built on Pylons, so if you think you'll need the incredible flexibility provided by SQLAlchemy, and the speedy "quickstart" features that Django provides, that'd be a good option to look into.

Ben Bangert