Python Web Application Frameworks Go Wild, Wild West

by Noah Gift

My involvement with the Wild West side of Python came somewhat accidently. I am helping organize PyAtl and on June 14th we had an incredible meeting! My company Racemi gave a mind boggling demo of our datacenter management tool that is written in all python. Our FlagShip Product Dynacenter allows any OS, including Windows to move around to different hardware in the time it takes to warm reboot...go Python! Finally, Google gave two presentations, one on Cross Site Scripting Attacks and one on Twisted. We also officially launched the PyAtl website that night which is running the bleeding edge Turbogears stack of Sqlalchemy,Genshi, and Toscawidgets. My friend Alberto Valverde is in charge of Toscawidgets and the concept is really awesome! If you haven't met Alberto yet, you should, he is one of those rare exceptionally helpful, yet insanely smart people.

Here is where the the fun started...

I invited Mark Ramm and Jonathan Lacour to come to our meeting and talk about Turbogears. Mark and Jonathan mentioned that on the way up to the meeting they had a crazy idea. How about building Turbogears on top of Pylons? They announced an experimental sprint the next weekend and this is where things got wacky!

Rick Copeland, Jonathan, Mark,Mike Schinkel, and myself met at Jonathan's house and started to experiment. We ran into an initial snag with understanding the pylons controller and I called up Shannon Behrens, another friend, who is insanely smart and incredibly helpful. Shannon works on the Pylons trunk and asked him how we would mount Turbogears on top of Pylons. After he got over the "you want to do what!", he helped us with some good advice. At some point we all went to get some Pizza, then came back to watch Jonathan and Rick go into the "Zone". After they came up for air, a controller was working and Frankenstein was born..mu ha, ha, ha, ha!

It was 1 in the morning by the time we all quit, but Mark, Jonathan, Rick and I decided to meet at Panera the next day at 1PM to finish it off. A little more work was done the next day, but part of the day was spent just hanging out and talking shop which was pretty cool as I hadn't met Mark or Jonathan before. It turns out Mark and I have a bit in common as we both grew up on a "Ranch type compound" for parts of our lives, we both have been SysAdmins, and we are both writing a Python book right now. Mark is a really fun guy to hang out with for anyone who hasn't met him yet!

So, after the weekend was over with I started to hear about some of the excitement. I emailed my most educated friend Mr. Phd from Caltech Titus and mentioned maybe he could contribute with some Twill stuff for TG2. I talked via email a little with Kevin Dangoor and noticed his big announcement.

Apparently, people were really fired up about the collaboration between Pylons and Turbogears. Lets face it, I am very excited that all of these smart people are working together! It now seems that some momentum in the battle for the perfect Python Web Application has shifted, as Pylons and Turbogears have the 800 lb Gorilla of ORM's in SQLAlchemy, and they have Toscawidgets which is about to come into its own.

I have written several small web applications in Turbogears and Django and I like both. Currently Turbogears and Pylons don't have a way to graphically manage the database like Django's admin tool and the API isn't as stable, but from what I hear this is about to change.....

I do get the impression that many people in the Turbogears/Pylons world feel left out and a common heard rallying cry is that Django has a "Not invented here attitude". Whether this is true or not, I learned this past week that if smart python programmers feel they aren't apart of the fold, they are capable of creating an uprising and doing just about anything!

I will close with this comment, Ian Bicking, who wrote paster which I think is pretty sweet, mentioned in a fairly famous post that it would be great, but unlikely that Pylons and Turbogears would merge, yet the impossible happened and the two frameworks are closely working together. May I suggest an equally implausible scenario? What if Django, Pylons and Turbogears worked on developing an interchangeable API? Is this impossible...you tell me!

13 Comments

Ian Bicking
2007-06-28 08:58:37
I don't think I said it was unlikely they would merge, only unlikely and perhaps not a good idea for them to first decide to merge. The alternative being that someone merges them, then people decide if it was a good idea. Which is what seems to have happened, and looks like it's going pretty well. So kudos!
Noah
2007-06-28 14:53:10
That is a subtle distinction, but I think your post opened up the possibility to many perhaps. So, what about Django then? It is kind of weird that we all have this beautiful language that is incredibly powerful, yet sometimes we implement the same thing many, many times. Is there a future for Django working with Zope, Turbogears and Pylons? Or will Zope, Turbogears, and Pylons reuse and share their components and Django will continue to stay tightly coupled. I can't wait to find out the answer to this in a year.


In some ways, I wonder what Python Web Applications could be if we focused our energy on becoming the obvious choice in leau of Ruby on Rails. After all, we have the best ORM, the best standard library, the cleanest syntax, optional OO (which I think is a big plus) and a mature code base that has been around for quite a while.

John
2007-07-01 10:52:52
What made me (and probably lots of others) choose Rails over Python is the lack of quick starts with Django - look at the Rails web site - there are lots of "5 minute tutorials". Not many have the time to delve into something deeply, especially if they are not sure they'll like it. The ease of jumping in with Rails led to lots of users which led to lots of books which is even more encouraging to jumping in. Sorry, but stupid simple demos are needed for many of us. Also a good simple demo of how Mecurial and Trac can be utilized to create a complete development environment would also be beneficial. The good news is that you're right, Python has so many advantages that I'm reading stories on it even if I haven't jumped into using it yet.
Noah
2007-07-01 14:30:11
It is amazing how much of a Web Application Framework in any language is more about marketing than about technology. I think another reason why Python doesn't own the market on Web Application Frameworks is that many Python people have quietly done their own thing and written their own Python Web Application Frameworks. I guess the typical Python Programmer is a little bit older, and experienced than the typical Ruby programmer and probably not as flashy.


When DHH came out with Ruby on Rails it was a marketing dream come true. DHH is good looking, well spoken, brash and opinionated, and Ruby is a cool language. Ruby on Rails fit a marketing niche that was begging to be exploited. Ruby is fun, and very similar to Python and I actually like it quite a bit, btw.


There are so many more Python programmers, and Python has been around for so much longer then Ruby, that "turning the ship", so to speak, is quite a big deal. I think Python is "turning the ship" now and its big battleship is about to invade the Web Application Framework area in a bigger, noiser way than it has done in the past. My guess is that in a couple of years the Wild Web West of Python will be something of a stable world with a common API that all the Frameworks adhere to.


You are very right in saying that there need to be demos and examples. There are some incredibly smart people doing incredibly brilliant things in the Python Web arena, yet the marketing just hasn't caught up yet with Ruby. This does seem to be changing as we now have several Python Web Application books out or on the way to being published. It should be fun to see what happens.

Edward Bunt
2007-07-01 18:00:44
Noah, what Python web programming books are currently in the pipeline. I know there is currently a turbogears book as well as an upcoming django book. What other books are planned on being released?
Alexander Fairley
2007-07-02 00:30:55
First of all, Turbogears does have a graphical CRUD interface to the DB, called Catwalk, it just only works with SQLObject last I checked. It's not a big deal to put together your own that will work with sqlalchemy, which is what I did a few months back when playing with tg. Secondly, it's really no big deal that there's no PR machine banging the drum for python web frameworks. Python is language which survives for the same reason linux has, and C before it. It's damn useful to smart people, and smart people appreciate and find ways to use damn useful things, regardless of how shiny certain other folks may find certain less useful things...
Noah
2007-07-02 04:39:04
Ed,


There is one new Pylons book coming from what I hear. The Django book is coming out in Aug. The CherryPy book came out a couple months ago. Also, there is a new ebook on web testing in python: http://www.oreilly.com/catalog/functionalwt/, and another ebook comparing Pylons, Django and Turbogears called Next-Generation Web Frameworks in Python, http://www.oreilly.com/catalog/9780596513719/. I have read through both of these ebooks and they are both quite good! Also, there are some books coming out on the 800lb Gorilla ORM as well,which directly fuel many of the latest python web application frameworks. I am sure other people will correct me with the specifics.


Alexander: Thanks for the updates on TG. If you have developed a CRUD interface for SQLAlchemy, I am sure both Pylons and Turbogears people would love the help. Hopefully you can open source it....sounds fun.

mike bayer
2007-07-05 17:39:33
theres a SQLAlchemy book in the works too, and possibly a second.
Noah
2007-07-05 17:59:24
Mike,


I had heard a rumor like that too. Are you working on both books I hope? I know Jeremy Jones and I plan to ALSO cover a little SQLAlchemy in our book "Python for Systems Administration", but geared toward Systems Administration obviously.


You have the red hot python project right now...congrats! Any hope for integration with something crazy like Twisted or Stackless in the future?

Stephen Ferg
2007-07-06 05:55:57
>>> Jeremy Jones and I plan to ALSO cover a little SQLAlchemy in our book "Python for Systems Administration"



I've been wishing for such a book for a long time. I think Python would be perfect for our SysAdmins, but without a book geared to their special task-set, I haven't been able to make a good case for Python. (I'm not a SysAdmin myself.)


Can you tell us a bit more about the book? Will it cover both Windows and Linux/Unix/Solaris administration? How far along is it? Do you have a publisher and/or estimated publication date yet?

Noah
2007-07-06 19:54:44
Stephen,

"I haven't been able to make a good case for Python. (I'm not a SysAdmin myself.)"


Python has a cleaner syntax and more readable code than Bash, Perl or Ruby, although Ruby is a fairly nice language. Also, Python does not force you to be OO all the time. I think this is a big plus for Systems Administrators as often OO is not the right tool for the job.


Python also has a massive standard library and 3rd party development library thanks to the cheeseshop. Many animation studios, were I spent a good deal of time, are going toward Python, and they are a good example of how making reusable code and tools in Python can increase Systems Administrators Productivity.


"Can you tell us a bit more about the book? "


Sure! My mission is to explain in a pragmatic way, why Python is the ideal language for systems administration.


"Will it cover both Windows and Linux/Unix/Solaris administration? "


We will be focusing on *nix, and will have real life examples on most *nix Operating Systems including Red Hat based Linux, Debian based Linux, FreeBSD, quite a bit of OS X, Solaris, Irix, AIX, HP-UX, and more. We wanted to give *nix an exhaustive treatment so Windows will not be covered at this time. Windows may be covered in future works.


"How far along is it?"


We should have a couple of chapters done by Aug, and we plan on releasing through Rough Cuts. If you have any ideas for things you would like to see included make sure you let us know. We appreciate the feedback!


"Do you have a publisher and/or estimated publication date yet?"


Yes! O'Reilly, which was ALWAYS or first choice, will be publishing the book. We felt strongly about having O'Reilly publish what could be the definitive book on Python for Systems Administrators.


The publication date will approximately mid 2008, but this is an estimate.


Stephen Ferg
2007-07-09 07:54:50
Thanks!


I DO have a suggestion. You might want to put some information in there about EasyGui http://www.ferg.org/easygui/index.html.


EasyGui makes it really easy to put a simple graphic user interface on the kind of utility scripts that a sysadmin might write.

Massimo
2007-11-06 22:46:28
The problem with python web frameworks is that they tend to have a bottom-up instead of a top-down design so they are always under-development projects with unstable APIs out of sync with the documentation. I have see the same problem in other fields. So, one day I made Gluon http://mdp.cti.depaul.edu