Slashdot Mirror


Six Python Web Frameworks Compared

snydeq writes "InfoWorld's Rick Grehan provides an in-depth comparison of six Python Web frameworks, including CubicWeb, Django, Pyramid, Web.py, Web2py, and Zope 2. 'No matter what your needs or leanings as a Python developer might be, one of these frameworks promises to be a good fit,' Grehan writes. 'As usual, the choice is highly subjective. You will find zealots for each product, and every zealot is able to present rational reasons why their chosen framework is superior.'"

16 of 111 comments (clear)

  1. That One With The Fish Slapping Dance by Jeremiah+Cornelius · · Score: 2

    Really. Best of the lot. Much more direct than those oblique, "All-England Summarise Proust Competition" bits. Leave the PhD at home, and make 'em larf a bit!

    --
    "Flyin' in just a sweet place,
    Never been known to fail..."
  2. What?!? No Flasks or bottles in sight! by Terrasque · · Score: 3, Interesting

    Any python web framework shootout that features neither a flask nor a bottle is not worth drink...err reading!

    --
    It's The Golden Rule: "He who has the gold makes the rules."
  3. Re:Really? by Mitchell314 · · Score: 2

    I'm pretty sure "import ruby.on.rails" should work in python.

    --
    I read TFA and all I got was this lousy cookie
  4. Re:Doesn't matter which. At least it's not PHP! by rubycodez · · Score: 2

    PHP isn't used much outside of web development. If you have web python skills you can also do other types of Python (command line, daemon) work. if you can get a job, the python one will generally be higher paying because it tends to be used for more technical, engineering, and scientific type applications. But, there are less web python than web php5 jobs.

  5. In-depth? by halfnerd · · Score: 2

    Surely you are joking?

  6. Re:Doesn't matter which. At least it's not PHP! by PCM2 · · Score: 5, Informative

    How much programming do you know now? Because if the answer is "very little" (or none), then you would do well to stay the hell away from PHP for as long as you can. PHP is useful because it's widely available on shared hosting servers, but as a language it is truly terrible. It will confuse you and leave you scratching your head at how to solve a problem at the same time that it's teaching you bad habits.

    Just for starters, PHP's library is full of inexplicable inconsistencies. For example, the arguments for mysql_query are "querystring, resource." The arguments for pg_query (for PostgreSQL) are "resource, querystring." Why? Don't ask. This is just one example of the typically slipshod way PHP has been put together. Note, also, that in both cases "resource" is optional. Die-hard PHP programmers will surely chime in at this point, telling you you're much better off using a database abstraction layer anyway, but which one? The PHP documentation lists four, but there are more than that.

    Python overall has been designed with much more care and forethought, is a much better language, and doesn't deserve to be put down like lame horses and PHP should be.

    That said, if you want to get more Web work, faster, learn PHP.

    --
    Breakfast served all day!
  7. Re:CubicWeb? by thatkid_2002 · · Score: 2

    The omission of Flask and CherryPy was indeed quite curious as they're certainly very popular.

    However I think that Twisted/Tornado are outside the scope of the article given that they aren't exactly web frameworks but rather components that can be used in web frameworks.

    I think the question that matters most of the time is not really "which framework" but rather "which database/ORM" or also "which templating system".

  8. Anything ready for the real world yet? by AtlantaSteve · · Score: 2

    The last time I tinkered with Django, I tried writing a simple CRUD app for an existing database at my job. After wasting a few hours learning how the ORM package works and setting up my models, I came to realize that Django does not support database tables with composite primary keys . In other words, it doesn't work with almost any legacy database that you will find in any enterprise shop on the planet. It wasn't worth re-working the schema, so I had to retreat back to Spring MVC and wrestle its XML.

    I'll give Django credit, though. It's still several steps ahead of Ruby on Rails, which my last experiment taught me doesn't support more than one database per app !

    I make a point to take one these "dynamic language" frameworks for a spin every 6-12 months... because I keep hearing that they are leapfrogging Java, and Oracle is destroying the universe anyway, and my career will be over soon if I don't migrate my skillset. So far I'm just not seeing it, though. These frameworks may be useful for simple non-commerce apps, stood up in a hurry by junior-level devs... but none of them seem remotely ready for any of the realities I deal with day-to-day when working for large companies or handling commerce.

  9. Re:Oh, python by Funnnny · · Score: 2

    I use bash to clean data: rm / -rf

  10. SQLAlchemy by slackergod · · Score: 2

    While I'd like to it not be the case, I'd have to agree with you about the general not-quite-there-yet state of dynamic frameworks. That said, Django's custom ORM leaves much to be desired. Next time you decide to give a python framework a try, pick one which uses SQLAlchemy as it's ORM layer. You'll find it to be a much more sophisticated library (similar to Java's Hibernate). In particular, it has all the features you just mentioned. Not integrating SQLAlchemy is one of the main things that keeps me from using Django... any other ORM layer in Python seems doomed to play catch-up.

  11. Re:Doesn't matter which. At least it's not PHP! by Tumbleweed · · Score: 4, Insightful

    Career-wise, there are WAY more PHP jobs than Python jobs, so if you're looking to be employed by someone else, PHP first (but don't stop with just one). If you're going to be doing your own projects, Python has evolved in a much more logical way than PHP.

    It depends on what kind of web development career you want - there are lots of specialties these days. Learn PHP, and learn all the associated web technologies REALLY WELL (html, css, javascript, ajax, etc). Get really good with an IDE (probably Eclipse). Learn how to use Photoshop and maybe Flash (or Edge). Learn SQL - MySQL especially, but also maybe some NoSQL tools. Learn the backend stuff like memcache, hadoop, etc.

    The more stuff you know, the more employable you will be.

    Learn how to write well. Being able to express yourself goes a long way in a technical career.

  12. Re:Doesn't matter which. At least it's not PHP! by Tumbleweed · · Score: 3, Informative

    Oh, and learn jQuery after you learn Javascript (not 'instead of').

  13. Re:Doesn't matter which. At least it's not PHP! by AliasMarlowe · · Score: 2

    Not learning PHP will likely save you from hanging yourself with an Ethernet cable in shame once you discover how thoroughly PHP mutilates you mind.

    Curse these flimsy UTP ethernet cables! They keep breaking when I put my full weight on them. Where is thickwire when you really need it?

    --
    Those who can make you believe absurdities can make you commit atrocities. - Voltaire
  14. Re:ironpython? by equex · · Score: 3, Funny

    Hey guys, someone admitted he was wrong about something on the internet. Print this thread and frame it on the wall!

    --
    Can I light a sig ?
  15. Re:Doesn't matter which. At least it's not PHP! by styrotech · · Score: 3, Interesting

    One thing to keep in mind with modern web development:

    Learning the server side language is only a small fraction of the total learning curve.

    You will need to eventually learn databases, a smattering of basic sysadmin skills, Javascript, HTML, CSS, a bit of HTTP, and not least the web frameworks or associated libraries and APIs themselves.

    With most frameworks sorta looking like MVC (whatever that ends up meaning these days) and the basic problems being the same, part of the learning curve of one system will help with learning another. Most web developers worth their salt will end up knowing multiple frameworks and server side languages anyway.

    You should actually try out both Django and something like Symphony2 (PHP) yourself to see which you prefer. Spend a week or so on each running through tutorials and creating demo sites. You'll soon get a feel for whatever you prefer.

    Career wise, language popularity isn't necessarily the most important thing really. Niches can still be profitable depending on where you are and supply/demand etc. eg there are plenty of PHP jobs, but standing out from the hordes of barely capable PHP developers can also be difficult for the less experienced.

    If you have to just start with one thing though, Django is a good choice. It's the most popular Python framework, and Python is a much better language for learning good coding habits than PHP. And if you later decide you prefer PHP (or the PHP job market), Symphony is still pretty similar from an architectural / functional point of view and having another language behind you gives a better idea of what not to do in PHP. Or if you end up really liking Python, you have lots of other options later for other frameworks if Django ends up being a bit limited or not quite to your taste.

    Just stay flexible and open minded, and know that web development will require ongoing learning no matter what.

  16. Re:Doesn't matter which. At least it's not PHP! by PCM2 · · Score: 2

    The answer to "which one?" really depends on your needs (which is why there are multiple extensions in the first place).

    I disagree. The reason why there are so many extensions that do more or less the same thing is that nobody in the PHP community can agree on a good way to do something. And this goes double for the core language, which includes features that do the same thing already, except that the features in the core language are so bad that you should skip them and start looking for an extension to do it right. The end result is no two PHP programmers will be doing things the same way, because they each picked a different extension to solve the same problem that PHP failed to solve for them.

    What?

    You heard me. If you want to get a lot of work programming for the Web, don't learn Python, because Python is relatively uncommon in Web programming, while PHP is near ubiquitous. You will get more Web work knowing PHP than knowing Python. That doesn't change the fact that PHP is an awful, awful language.

    --
    Breakfast served all day!