| « Templating languages, and YAPTL | 0.2-rc1 » |
How Python wins on the Web
Recently, it seems like everyone's been focused upon creating The One Framework -- the Ruby on Rails of Python. In fact, I'm almost as guilty as everyone else. We have failed in this regard, and we will continue to fail. We've been struggling to find the best practices and combination of tools to create Joe User's average database-backed dynamic web site and application, and not only can't we agree on how to do it, no actual end-users care when polished solutions like Rails and ASP.NET are in town. Not only that, by many accounts Ruby seems to be overtaking Python in its rate of growth. Personally, I'd rather write Python.
But oh, how quick are we to forget Python's smashing successes in the Web world. We've got Plone, probably the most popular and comprehensive CMS out there. We've got the platform its built on, Zope, which is (from what I hear) fairly popular, too. We've had PyBloxsom, which until WordPress came along was a very widespread blogging system. Let's also not forget MoinMoin and Mailman, some of the most widespread Wiki and mailing list applications on the Web today. And hell, we've got Python's "killer" web app, Trac, which just about everyone is using these days. And oh, BitTorrent. I know it's not a Web application in the traditional server-side sense, but it just shows how capable Python truly is.
What do all of these applications have in common? They certainly don't share a web framework; most of them are developed specific to that application and tailored to various deployment platforms (CGI, FastCGI, custom server, mod_python). Python appears to be falling behind in the world of custom-made Web applications, but in the world of generic, reusable Web applications, Python is doing great.
And let's not forget about the great achievement of Web-SIG: WSGI. Now, we have a system that lets us write an application once and deploy it upon any WSGI-compliant server or gateway (to name a few, ISAPI, mod_python, CGI, FastCGI, SCGI, custom HTTP server).
Here's what I propose: screw Web frameworks for now. We won't win in the Rails generation. Perhaps when some ingenious Python programming comes up with that next-generation Web framework (Seaside + ZODB + LINQ + ASP.NET + PyMeld + LivePage + CrackAJAX, anyone?), we can give the Web framework wars another shot.
For today, let's work on making generic Python products. Let's make a kick-ass community forums system, an incredible blogging system, a news script, a CPanel/Webmin clone that people will use because of their features, not their programming language. Commentary is a great example of what I'm talking about. Let's not forget to make sure Trac, Plone, and all of our applications run seamlessly on WSGI, and let's make our WSGI gateways ironclad and diverse.
And, most importantly, let's all get behind what I believe is the most pressing and important concept in the Python web development world today: Paste Deploy. What Python needs more than anything is a brainless, quick-and-easy way of connecting applications to gateways. I want to drop a CGI file on to a Web server, point its config file to (the fictional) pyBB-1.0.0.egg, chmod it, and have it Just Work. I want to do the same thing for FastCGI. In fact, what I would love more than anything would be a portable mod_wsgi across Apache, LightTPD, and IIS: a module that would let me drop a .egg file into a directory and have it automatically pick up and install the WSGI application from the archive. Once we've got this, a standard, portable way of easily installing ANY Python web app, we'll be getting somewhere.
Happy hacking.
25 comments
You forgot MoinMoin and Mailman, another insanely successful Python web applications.
Besides (and above) Plone, CPS is the most complete and full-featured open source Python-and-Zope-based Enterprise Content Management System.
It is now used on large-scale intranets, as well as public web sites like Culture.fr or interieur.gouv.fr.
See This blog entry for more information.
Quite frankly, being new to Python and being mostly a web developer with PHP (although I also know C and Objective-C), I like the language but for the web, Python really sucks.
People currently working on frameworks like Turbogears or Django are wasting their time. There are so many things that should be fixed first before going into such a level of details. Nobody is going to use their framework.
Compared to php, where you take a script, install it somewhere and call it through Apache, done, Python is way behind. Mod_python is borked, requires Apache 2, PSP are useless and it doesn't even compile properly on OSX.
I am really sad about this situation. It seems that the Python community is composed mostly of hackers who like technical challenges but never really finish the job to the point it reaches its target (Trac is actually an exception).
Your examples of Plone and Zope being widely used are laughable compared to CMS like Mambo, Drupal, Spip, ezPublish, etc. in PHP.
If Python for the web wants a broader audience, it is in my opinion the right time. A lot of PHP developers are currently looking for another language to learn and if Ruby comes to mind, Python is appealing too.
What Python needs is a single way to do basic things like install an application and have it run on a server, probably through fastcgi as it seems Apache is not as popular as it used to be (thanks bloat).
There is no need for a web framework before the basics are settled like in "The common way to run a Python web application is to use lighttpd with fastcgi and Saddi's fcgi.py (or whatever is best for 80% of cases, I couldn't yet figure it out myself...). Once this is said, people have the choice to try twisted, snakelets or whatever. PHP has Apache and mod_php. PHP also had MySQL. That's for the 80%. Now, it also runs on Caudium with Ingres...
Mod_python actually hurts the development of Python for the web IMO. It fills the spot but is not maintained or developed. It has a lot of requirements and doesn't compile properly on some platforms.
Write a tutorial for the 80% and then you win.
I could be wrong, but I think ODEO uses Python for their client too...
"Personally, I'd rather write Python."
Maybe, but a lot of folks would apparently rather write Ruby.
How could you miss django - the newest kid on the block with over a 100 production sites in six months - and it hasnt been released yet
See, this is why I think this is so important. I don't think people would rather write in Ruby, I think they would rather write in a dynamic scripting language, and they are discovering and using Ruby because of Rails, rather than Python.
What Python needs is a single way to do basic things like install an application and have it run on a server, probably through fastcgi as it seems Apache is not as popular as it used to be (thanks bloat).
Is this really the sort of thing a language should be concerning itself with? Given the spectrum of environments Python finds itself in, is this even a realistic goal? I live in a little Python world so excuse my myopia, but I don't even see that this is a weak point as things stand. Distutils does, IMHO, an excellent job of doing the bulk of this, and OS-specific software management tools (ie, FreeBSD ports, RPM, that Debian thingie) do the rest.
I think the real reason that Apache is in decline in the web application space is that, really, web servers aren't very complex when you get down to it. Most of the complexity comes in when you try to expose all the HTTP state and machinery to your application. Given that, there's little reason for your application to not BE a web server.
Peter, you are really kidding yourself here.
Take bittorrent off the table because it's not a webapp. You ask "what do all of these applications have in common"? I'm afraid the significant answer is: they all date from before the introudction of Ruby on Rails!
People have been sick of J2EE for a while, fleeing it into many directions, mostly php, but also to python, lighter open source java frameworks, etc.. But that was then. Now, RoR is the giant billboard saying "come here". If you were a new J2EE refugee planning a webapp like one of those, with no experience of python or ruby, it's much more likely you'd choose RoR for the implementation.
This is because of RoR's momentum, because of better marketing, better packaging, a better deployment story, and plain better quality as a framework -- all the reasons that have been done to death lately.
And it does no good to argue that RoR is suited for "custom-made Web applications". The technology which dominates that sector will eventually climb up to dominating the product webapps. Look at the example php. Ever consider why wordpress displaced pybloxsom?
I'm not cheering for this since I've been using python for five years and greatly prefer its syntax to ruby's, but that's how the cookie crumbles. I am not eager to learn ruby, but I imagine I will. The sad truth is the python community just blew it on this. The fact that people haven't even accepted this fact, is just another indication that it's almost certainly too late to catch up.
Umm, okay, just re-read what I wrote, and it sounds a touch more personal and argumentative than I meant.
Sorry. Not trying to be unpleasant. I'm as frustrated by the situation anyone else...
Comment from: S. Fermigier
http://www.nuxeo.com/
Besides (and above) Plone, CPS is
the most complete and full-featured
open source Python-and-Zope-based
Enterprise Content Management System.
Stéphane Fermigier, never above tooting his own horn...
What Python needs is a single way to do basic things like install an application and have it run on a server,
Check out http://pythonpaste.org/
MWM
what is the problem of J2EE portal JSR 168? I think it will works properly.
I like python, i'm pretty new to it but i like it.
I've written an application using TurboGears, and at first it was hard to get my head around it and the little python language control that I needed to make it work... but once i got the hang of it i immediately fell in love with it.
The jump between writing python code for the web and writing PHP code is massive!
The difference in layout, the difference in the amount of code needed, the aesthetic of it all:-)
Its jsut really nice to be able to use a real programming language on the Web.
It might not be as easy to set up, and it might be really hard to get a n affordable hosting, but that has to change. And I'm sure it will. I just hope more people are seeing the light.
Good point for Microsoft that they have officialy adopted IronPython for ASP.NET platform. I guess they needed something to compensate java. Real plans of M$ are unknow, maybe they will introduce P# in the future.
I try to use Python everywhere possible. For most web apps I end up using PHP, but when I need a more robust framework I always think of Python next.
I miss a benchmark on the web. I saw such thing for programming languages. There are to main critteria: performance vs. development. It would be nice to see the same functionality application to be programmed in various web frameworks with measured performance.
Maybe, this would be to much simplified.
You're fogetting, I think, the largest problem facing python + web: deployment. Until cheap hosts and sysadmins can just as easily run PHP on apache side by side w mod_python (or some new thing) python + web won't catch on. Plone and Zope are miserably complex. Focus should be on creating an easy method of stable deployment, and that would be mod_python without prohibitive dependencies and without the security concerns those cheap hosts may have about users being able to "touch" more of the apache process. You can code as many blogging systems as you like, but until you can pack it and hand it off to Joe blogger for his $10 a month server, have him click intall it like Wordpress, you haven't even got a foothold on the mountain.
for an incredibly small and smart Python web toolkit check out http://webpy.org
werkschoenen
as a note.
Cpanel IS written in python. (I know, I run five cpanel servers and have used it for years)
Eve-Online, one of the big MMORPG's is written in Python. (stackless.com)
Google uses Python all over.
We have a lot of successes. Rails is currently more buzz and a lot of larger companies don't want to touch it because it is not mature yet.
Always looking for more info and comments on Python. Every time I think I've learned something, I keep finding out how much of a newb I am. Oh well.
I have to agree with noob, python could in theory be useful as a web framework but why.That is not where it belongs I believe php does its job there, and having toyed with rails I just dont think that python should try to compete with those two.I know it is a great way to become a "popular" language,at last check popular was for the teenagers with ipods and zwinkys. I believe that python is well suited for programming and will only find continued success if it focuses in that direction. If you need scripts use perl or php, need a good framework join the rails bandwagon! One more thing I just have to laugh when I read about how java is developing some new piece of mind numbing coma inducing crap that is going to revolutionize the web ah bullstein! Java blows, and python rocks I just dont want to see it turn into another huge hack.Python is a happy thing :-) unlike the little shop of java beast that sucks the life out of a coder and spits out a lifeless carcass of a once contented and prosperous individual!Just my opinion oh and by the way I just read that I could have used mark-up Dang I could have really got my point across that way..Remember if you cant laugh at yourself then make fun of other people!
I agree that we need to make it easier for developers to deploy applications, so why not do it through a web application as Gluon does?
http://mdp.cti.depaul.edu
Gluon is a free open source framework for agile development of secure database driven web applications, written in Python, programmable in Python. Stable API and supported since October 1st 2007. Gluon requires no installation and includes a ticketing system and a web based database administrative interface.
This post has 7 feedbacks awaiting moderation...