In 2011 I did an evaluation of various Python web frameworks to guide Points’ foray into Python.

tl;dr Django or Flask

We have a lot of criteria (link to the full eval below). Some of these weighed more heavily than others:

  • Release & Dev Activity
  • Source Code Sponsor / Related Company
  • Notable Sites Using It
  • Popularity
  • Experience Using It
  • Built in ORM
  • MS Windows Supported
  • Test Framework
  • LOC
  • Invasive / Tight Coupling
  • OAuth 1.0 plugin
  • OAuth 2.0 plugin
  • OpenID plugin

The criteria related to momentum and developer support — how easy is it to find troubleshooting information and best practices — weighed most heavily. Another concern was how coupled the code becomes to the framework itself. For example, if a Django app is not built with the utmost care, it becomes extremely difficult to switch from Django to another web framework later if the need arose.

We were not concerned with high volumes / high concurrent connections / comet, so async / evented ( libevent / epoll / kqueue ) based frameworks (e.g. Tornado) were not a big weight.

Django is the Rails of Python, but it comes with a lot of baggage. (Over 60,000 lines of code worth of baggage.) You get everything and the kitchen sink. If you’re not using its built in admin, ORM, and templating, it’s not quite as compelling. There are quite a few black boxes and mastery of Django can take some time. However, for workflow apps it’s an awesome rapid development tool.The plugin ecosystem is amazing, too. Want LDAP integration? Login with Facebook / OAuth or Google / OpenID? The Django packages have you covered.

Flask is a micro framework, which means you’re left to plug in other libraries to do things like ORM. This is great if (for example) you prefer SQLAlchemy to Django’s ORM, or if you’re doing NoSQL like CouchDB or MongoDB. It’s a simple, easy to understand framework, but it doesn’t yet have the critical momentum of Django.

Thanks for reading!

Michael Lossos

Shares 0