Squeeze of Python

This is a free Python Magazine and personal blog of S Ramdas.

Friday, February 10, 2006

Pylons vs TurboGears

I have been trying to zero down on a Python web framework for quite some time. I know I have company since BDFL himself is searching for an option.

The idea is to build a CMS system that is practical to current editorial teams I work with. Most portals/ news sites, I am building have distributed teams, and I am finding it difficult to scale the existing PHP based code base. Mind you the CMS systems we use for Developer IQ and now for Marketflash, lets you file a story in less than 30 seconds and is good enough for current day requirements.

Django looks good, and is the most stable of the new generation Pythonic frameworks.

Last two years I tried not once, not twice, but umpteen times to learn Zope and then Plone. I even attended a three day training course which came free of course. I managed to create a few pages, and even a half baked tiny application. Now I have given up the Zope and Plone stuff for good.

Plone is cool and is very good, if you want to set up an Intranet kind of an application. In fact I will recommend it over any other available free stuff that I have played around with. Can’t say much about stuff I have not seen.

However, the learning curve just seems to be too steep.

Django is quite elegant, but somehow TurboGears was interesting as CherryPy is a web server that I am familiar with. I had almost finalized on TG, before someone pointed me back to Pylons. What attracted me to Pylons were the simple design and the Myghty template system.

Now the choice is between TG and Pylons. I am looking at choosing between either of them in next 20-30 days.

I need to make a decision based on the following factors

1) The project needs to get into a state of stability (within the next 3-4 weeks) where the code will not break as it stabilizes to a 1.0x. I am hoping to start off on developing a more complex distributed content management system by that time.

2) The project needs to be installed on a regular server which dishes out LAMP pages belonging to my existing ISP.

3) The web server should be able to handle 5000 requests a second. The LAMP systems which we use have survived peak traffics of similar counts with élan.

4) I know it’s difficult to know now, but I want to go with the project, that will have longer and faster legs. The predicament with most Open Source projects is they lose steam midway, and this can be very frustrating.

Those were the business considerations.

On Technical front, I am not able to figure out which among the two is better?


If you compare the learning curve I guess TG and Pylons are almost on the same tangent. What is missing (at least as I write) is that there is no Ajax plug-in read made with Pylons, and at the same TG lacks caching.

Both uses SQLObject and Formencode. TG uses Kid while Pylons has betted on Myghty.

Perhaps someone who has worked with both the frameworks can write a note on "Pylons vs TG" and can help me and many more like me.

16 Comments:

At 5:29 PM , Anonymous Anonymous said...

structure of pylons is very more flexible than turbogears.i like pylons more than turbogears.

 
At 5:30 AM , Anonymous Anonymous said...

I have looked at turbogears, used pylons and used django. I ended up with pylons and have written two apps using it with incredible productivity improvements. My brief journey with each framework is outlined below with the problems I encountered. My executive summary is this. Pylons is a "I'm behind you all the way" type of framework whilst the other two frameworks are "I'll lead you all the way" type of framework. Which ever you choose I guess depends on the type of developer you are.


Turbogears.
I tried to go through the turbogears tutorial, but the decorators just seem to turn me off. I have also had cherrypy problems in the past (with sessions) so was turned off by it's use of cherrypy (this is now fixed i think but it's was too late for me). Also the cherrypy feature of def function(self, arg1, arg2, arg3) did not sit well with me because alot of my forms pass a great many parameters which meant very ugly looking method signatures as well as breaking the DRY principle (which i try to adhere to for simple things). Wrapping it in the TG forms decorator was possible, but that just meant using cherrypy was of no use at all.

Django.
I tried out django which seemed very promising at first. The admin interface is very very nice. The generic views approach brought a different perspective to what I usually achieve with controller inheritance. The orm was quite nice (although a bit arcane (this was before magic-removal)). The "Admin" inner class was a very nice idea.

The problems I came across include:
1. Using the django template to template my pages felt like templating with my hands tied. I know this was a design feature, but it didn't suit my style of development. I am not writing blog/wiki applications where I worry about malicious templates. I want power and flexibility with minimal of effort. I didn't want to learn a whole new template language which to me didn't offer enough of a gain. simple things like "if" tags with no "elsif" didn't sit well with me. This template language was not designed for me as a software developer.
2. The ORM seemed nice, but not as nice as SQLAlchemy (SA). It didn't provide a way for me to use SA, and everything is so tied to each other in this framework that I wouldn't have gained much benefit from the framework if I was able to use SA anyway. i.e No Admin, No default manipulators, No generic views.
3. url configuration seems so messy and can get real messy it you have large apps. I like the regex support but for the types of applications I build, the url is not that important to fine tune as much as django wants me to.
3. The biggy was the uncertainty of what exactly django features could do for me. eg. How far could I take the Admin interface before I should use a generic view. How far could I take a generic view before I have to write my own controller. It also doesn't support an incremental style of development either to step from one feature to another. eg. if you start using admin (and customising it for some models), then decide to use a generic view, then decide to write your own controller; besides the model I couldn't anticipate reusing "as is" most of my templates, or controller code/files. I would have to rename, recopy, re-url.py etc. etc.

Pylons/Myghty
Plus
-Templating language because it's just python with some very powerful extension tags and concepts. I was freed from the application language to templating language mismatch. That's the way we work here. True design is done by designers, but templating is done by programmers in our shop.
-Did not bind me to any ORM (although it gives special mention to SQLObject). I use SQLAlchemy (SA) and it is one hot piece of software.
-Simplicity. I understand it's guts. The controller is a no brainer. Nothing weird.

To be fair, I wrote some stuff to do things like Django Admin/generic views using (SA) so although the ideas are similar between my Pylons dev environment and Django, I have removed what I feel are warts in Django by using Pylons. It allowed me to do this without making me feel like I was losing out on its strengths.

Minus
- Docs are being improved currently, but at the moment are a bit thin. However, mailing list support is great and usually very quick.

 
At 1:16 PM , Anonymous Anonymous said...

Thanks Huyo,

I am a bit worried about the pace of progress. In many ways, Pylons is a wrap around on Myghty and it is not a bad idea. But the progress has been slow so far. I am not talking about the versioning, but some of the cool features such as identity, widgets which TG boasts off are missing. Or am I missing something?

 
At 4:16 AM , Anonymous Anonymous said...

Hi Ramdas,

There are too many things in Turbogears that i don't like which strikes it off my list before I even get to things like widgets and identity. I am not exactly sure what these features give to the end user, but I have written a simple widget library for pylons and I deal with users by myself according to my application needs. True i have no ACL in place, but that is not that hard. There are bigger problems to worry about with turbogears (IMO) then widgets or identity. Those are just icing on the cake, but too bad for me, I don't like the cake in the first place.

 
At 4:19 AM , Anonymous Anonymous said...

Reading your post, i just realised that maybe none of these framework satisfy your needs. 5000/req per second is huge if you're talking about one server. Can turbogears really handle that ?

 
At 11:12 AM , Anonymous Anonymous said...

Huyo

I agree 5000 request a second is too much of an ask. In fact 50 requests a second is also cool as far as I am concerned. Is there a place where I can find more on Pylons development. There is just one doc that is useful as of today

 
At 5:44 AM , Anonymous Anonymous said...

I think Aaron Swartz's web.py can handle 5000 requests per second. :) Then again, it probably doesn't meet your other needs.

 
At 8:02 AM , Blogger Ramdas S said...

have become a Django believer after playing around with everything from web.py to TG. Django simply has the momentum, the numbers behind it, and despite all the negative points that people speak off, it delivers especially for the kind of work we do.

Apache Mod Python does a decent job of request handling.

There are a few reasons why I am banking on Django.

The biggest is that of all frameworks, I see maximum number of users/developers for Django and this trend will continue for at least end of next year. I know Zope 3 is great and promising, but I do not see the same kind of momentum.

I build web apps for a living. And 50% of the time I need to write something that I have never written before. It's nice if I can go back and find some code, where someone else has already resolved the problem.

With the number of open source code.google projects on django, I feel 90% of what my clients need me to do I can just grab it off the shelf, customize, value add and ship.

Learning curve on Django is also smaller. A web developer ( someone who understands the fabric of the net or even with some PHP/ASP background) who's learnt Python, can be productive in less than a week on Django with some help from a slightly more experienced hand like me.

While there are several interesting frameworks that are around, and more are likely to come since Python makes it easy to create a framework all by yourself, Django will be the preferred way to write code at least till end of 2008.

Sorry if I bored you. I think I will blog about it in detail after almost a year.

 
At 4:36 AM , Anonymous Anonymous said...

Hi Ramdas,

i have found this book:
http://pylonsbook.com/
if you are still interested in documentation on pylons

 
At 2:43 PM , Anonymous Anonymous said...

MANDY MOORE NUDE
[url=http://profiles.friendster.com/120699084]MANDY MOORE NUDE[/url]
MANDY MOORE NUDE
[url= http://profiles.friendster.com/120699084 ] MANDY MOORE NUDE [/url]
MARCIA CROSS NUDE
[url=http://profiles.friendster.com/120699102]MARCIA CROSS NUDE[/url]
MARCIA CROSS NUDE
[url= http://profiles.friendster.com/120699102 ] MARCIA CROSS NUDE [/url]
PAZ VEGA NUDE
[url=http://profiles.friendster.com/120699126]PAZ VEGA NUDE[/url]
PAZ VEGA NUDE
[url= http://profiles.friendster.com/120699126 ] PAZ VEGA NUDE [/url]
SOPHIE MONK NUDE
[url=http://profiles.friendster.com/120699166]SOPHIE MONK NUDE[/url]
SOPHIE MONK NUDE
[url= http://profiles.friendster.com/120699166 ] SOPHIE MONK NUDE [/url]
SOPHIA BUSH NUDE
[url=http://profiles.friendster.com/120699183]SOPHIA BUSH NUDE[/url]
SOPHIA BUSH NUDE
[url= http://profiles.friendster.com/120699183 ] SOPHIA BUSH NUDE [/url]

 
At 1:05 AM , Anonymous Anonymous said...

MICHELLE RODRIGUEZ NUDE
[url=http://my.curse.com/members/KARYN3.aspx]MICHELLE RODRIGUEZ NUDE[/url]
MICHELLE RODRIGUEZ NUDE
[url= http://my.curse.com/members/KARYN3.aspx ] MICHELLE RODRIGUEZ NUDE [/url]
GISELE BUNDCHEN NUDE
[url=http://my.curse.com/members/KASANDRA3.aspx]GISELE BUNDCHEN NUDE[/url]
GISELE BUNDCHEN NUDE
[url= http://my.curse.com/members/KASANDRA3.aspx ] GISELE BUNDCHEN NUDE [/url]
MARY LOUISE PARKER NUDE
[url=http://my.curse.com/members/KASHA7.aspx]MARY LOUISE PARKER NUDE[/url]
MARY LOUISE PARKER NUDE
[url= http://my.curse.com/members/KASHA7.aspx ] MARY LOUISE PARKER NUDE [/url]
PATRICIA HEATON NUDE
[url=http://my.curse.com/members/KASIE2.aspx]PATRICIA HEATON NUDE[/url]
PATRICIA HEATON NUDE
[url= http://my.curse.com/members/KASIE2.aspx ] PATRICIA HEATON NUDE [/url]
JULIA ROBERTS NUDE
[url=http://my.curse.com/members/KASSIE3.aspx]JULIA ROBERTS NUDE[/url]
JULIA ROBERTS NUDE
[url= http://my.curse.com/members/KASSIE3.aspx ] JULIA ROBERTS NUDE [/url]

 
At 6:55 AM , Anonymous Anonymous said...

PAULINA RUBIO DESNUDA
[url=http://www.projectopus.com/user/58041]PAULINA RUBIO DESNUDA[/url]
PAULINA RUBIO DESNUDA
[url= http://www.projectopus.com/user/58041 ] PAULINA RUBIO DESNUDA [/url]
JENNIFER ANISTON SEXIEST GALLERY
[url=http://www.projectopus.com/user/58043]JENNIFER ANISTON SEXIEST GALLERY[/url]
JENNIFER ANISTON SEXIEST GALLERY
[url= http://www.projectopus.com/user/58043 ] JENNIFER ANISTON SEXIEST GALLERY [/url]
SCARLETT JOHANSSON BREASTS
[url=http://www.projectopus.com/user/58045]SCARLETT JOHANSSON BREASTS[/url]
SCARLETT JOHANSSON BREASTS
[url= http://www.projectopus.com/user/58045 ] SCARLETT JOHANSSON BREASTS [/url]
ALEJANDRA GUZMAN DESNUDA
[url=http://www.projectopus.com/user/58047]ALEJANDRA GUZMAN DESNUDA[/url]
ALEJANDRA GUZMAN DESNUDA
[url= http://www.projectopus.com/user/58047 ] ALEJANDRA GUZMAN DESNUDA [/url]
RUBIAS DESNUDAS
[url=http://www.projectopus.com/user/58049]RUBIAS DESNUDAS[/url]
RUBIAS DESNUDAS
[url= http://www.projectopus.com/user/58049 ] RUBIAS DESNUDAS [/url]

 
At 7:39 AM , Anonymous Anonymous said...

EMMA WATSON BREASTS
[url=http://my.curse.com/members/KRISTEEN6.aspx]EMMA WATSON BREASTS[/url]
EMMA WATSON BREASTS
[url= http://my.curse.com/members/KRISTEEN6.aspx ] EMMA WATSON BREASTS [/url]
SHAKIRA DESNUDA
[url=http://my.curse.com/members/KRISTEN2.aspx]SHAKIRA DESNUDA[/url]
SHAKIRA DESNUDA
[url= http://my.curse.com/members/KRISTEN2.aspx ] SHAKIRA DESNUDA [/url]
CELEBRITY SEXY TEETH
[url=http://my.curse.com/members/KRISTINA6.aspx]CELEBRITY SEXY TEETH[/url]
CELEBRITY SEXY TEETH
[url= http://my.curse.com/members/KRISTINA6.aspx ] CELEBRITY SEXY TEETH [/url]
LINDSAY LOHAN BREAST SLIP
[url=http://my.curse.com/members/KRISTY3.aspx]LINDSAY LOHAN BREAST SLIP[/url]
LINDSAY LOHAN BREAST SLIP
[url= http://my.curse.com/members/KRISTY3.aspx ] LINDSAY LOHAN BREAST SLIP [/url]
MENORES DESNUDAS
[url=http://my.curse.com/members/KRYSTAL5.aspx]MENORES DESNUDAS[/url]
MENORES DESNUDAS
[url= http://my.curse.com/members/KRYSTAL5.aspx ] MENORES DESNUDAS [/url]

 
At 7:41 AM , Anonymous Anonymous said...

JOVENCITAS DESNUDAS
[url=http://www.projectopus.com/user/58579]JOVENCITAS DESNUDAS[/url]
JOVENCITAS DESNUDAS
[url= http://www.projectopus.com/user/58579 ] JOVENCITAS DESNUDAS [/url]
JENNIFER LOPEZ DESNUDA
[url=http://www.projectopus.com/user/58581]JENNIFER LOPEZ DESNUDA[/url]
JENNIFER LOPEZ DESNUDA
[url= http://www.projectopus.com/user/58581 ] JENNIFER LOPEZ DESNUDA [/url]
ARGENTINAS DESNUDAS
[url=http://www.projectopus.com/user/58585]ARGENTINAS DESNUDAS[/url]
ARGENTINAS DESNUDAS
[url= http://www.projectopus.com/user/58585 ] ARGENTINAS DESNUDAS [/url]
ADRIENNE BAILON NUDE PHOTOS
[url=http://www.projectopus.com/user/58587]ADRIENNE BAILON NUDE PHOTOS[/url]
ADRIENNE BAILON NUDE PHOTOS
[url= http://www.projectopus.com/user/58587 ] ADRIENNE BAILON NUDE PHOTOS [/url]
MICKIE JAMES NAKED
[url=http://www.projectopus.com/user/58589]MICKIE JAMES NAKED[/url]
MICKIE JAMES NAKED
[url= http://www.projectopus.com/user/58589 ] MICKIE JAMES NAKED [/url]

 
At 1:29 AM , Blogger Bathmate Hydromax said...

Vimax Pills is a powerful natural herbal male enhancement that increases penis length and girth, sexual desire, sexual health and helps to achieve stronger erections, Buy Vimax Pills best penis enlargement pills

about author:
best penis enlargement penis enlargement pills improve sexual performance and stamina

best penis enlargement pills VigRx Plus Vimax Pills ProSolution Pills clinicaly proven for enlarge your penis up to 3-4 inches in 3 month 100% money back guarantee FDA APPROVED
http://www.orderpenisenlargement.com
http://www.vimaxpenispills.com

 
At 5:26 AM , Anonymous Anonymous said...

BRAD PITT NUDE
[url=http://videoexclg46.vidiLife.com]BRAD PITT NUDE[/url]
BRAD PITT NUDE
[url= http://videoexclg46.vidiLife.com ] BRAD PITT NUDE [/url]
LUCY PINDER NUDE
[url=http://videoexclg47.vidiLife.com]LUCY PINDER NUDE[/url]
LUCY PINDER NUDE
[url= http://videoexclg47.vidiLife.com ] LUCY PINDER NUDE [/url]
LAURA PREPON NUDE
[url=http://videoexclg48.vidiLife.com]LAURA PREPON NUDE[/url]
LAURA PREPON NUDE
[url= http://videoexclg48.vidiLife.com ] LAURA PREPON NUDE [/url]
LIV TYLER NUDE
[url=http://videoexclg49.vidiLife.com]LIV TYLER NUDE[/url]
LIV TYLER NUDE
[url= http://videoexclg49.vidiLife.com ] LIV TYLER NUDE [/url]
EVA LONGORIA NAKED
[url=http://videoexclg50.vidiLife.com]EVA LONGORIA NAKED[/url]
EVA LONGORIA NAKED
[url= http://videoexclg50.vidiLife.com ] EVA LONGORIA NAKED [/url]

 

Post a Comment

Subscribe to Post Comments [Atom]

<< Home