[omaha] best python web framwork

Matthew Nuzum newz at bearfruit.org
Thu Jul 14 03:23:39 CEST 2011


On Wed, Jul 13, 2011 at 7:21 PM, jesse moseman <jmoseman01 at gmail.com> wrote:

> I've done some cgi for my "job" just generating html based off of a
> database
> and stuff but i'm looking in setting up my own test web server that's
> python
> powered.  I've heard of django but don't know much about it.  I know it's
> like a content management system but it doesn't have a front end.  One
> thing
> i also looked at was mod_python for apache.  Any one have any
> recommendations on getting python powered websites going on you're own
> server?
>
>
django isn't really a content management system and mod_python isn't a
framework at all. mod_python embeds Python in the web server and is
generally a bad idea currently. Instead use mod_wsgi (pronounced "mod
whiskey") if you have the option. (or fastcgi if you like to fiddle)

Here are a couple of my opinions on frameworks:

Django - I use this every day. It's extremely easy to be productive. It has
a lot of built in features. You don't need to learn a database, just
describe your data as a python class. You'll be going fast. Optimizing your
site can be challenging because the abstractions that make you very
productive also hide the guts of what's happening. For example, I had a page
that was going a bit slow so I installed the django-debug-toolbar and it
showed that what I thought was one SQL query was actually 13. I simply had
to use an option called select_related on that query and it turned into one
like I'd expected. My point is that the framework abstracts you away from
the details so sometimes there are a few surprises lurking in there.

Turbogears - it is a framework that is made of piecing some of the best bits
of many other python frameworks. I used this several years ago. Since then
it's changed a lot. At the time it used cherry py which is a great cgi-like
framework. It used an excellent database ORM and a more powerful templating
system than Django. It's main disadvantages were a smaller community and
that the pieces were not cohesive.

Flask - a very lightweight framework. Much more like cgi. You have a lot of
control over the inner workings of your app. It gives you some of the most
needed features of a web app and that's it.

Google App Engine - a platform that lets you use other frameworks (like App
Engine Oil) to publish Python apps to Google's hosted cloud platform.

Zope - don't use this unless you like xml and pain.

With any of these you can make a content management system or any number of
other web apps.

Here are some sites my team has made:

http://www.ubuntu.com/usn - a CMS for hosting security notices about Ubuntu
https://login.ubuntu.com/ - a single sign in service using OpenID
https://pay.ubuntu.com/ and the related Ubuntu Software Center (a web
service with a native Ubuntu client) - an e-commerce platform for handling
software purchases

If you like CGI I'd suggest Flask. If you want to go whole-hog into Python
web development I'd suggest Django. The only other framework I recommend to
anyone these days is Ruby on Rails but this is the wrong list for that. :-)

-- 
Matthew Nuzum
newz2000 on freenode, skype, linkedin and twitter

♫ You're never fully dressed without a smile! ♫


More information about the Omaha mailing list