Friday, March 20, 2009

Django vs Pylons: Pylons fails to deliver a pony?

Last year the Django community adopted the Django Pony as their unofficial mascot. Since then, I keep hearing a complaint about Pylons: that it lacks a pony.

I have an important message: this is a falsehood, most likely orchestrated by the Django marketing machine.

Pylons *DOES NOT* lack a pony -- Pylons (actually Paste) has included a pony (paste.pony) out of the box for 3 years, since the Pylons 0.8.1 release. Here's Ben Bangert demoing said pony at a Google tech talk over 2 years ago.

Typical Django and their NIH attitude -- instead of checking if Ian Bicking did it first, they just went off and made their own pony. That's fine though, we don't mind the Django pony. However the lies about Pylons must stop immediately. I demand a retraction and an apology from the Django camp.

Pylons and TurboGears 2 has a significant presence at PyCon if you'd like to apologize in person.

Tuesday, March 10, 2009

Deploying Pylons Apps to Java Servlet Containers

As of the 0.9.7 release, Pylons now supports Jython 2.5. The new snakefight tool can create a WAR file from a Pylons app via its bdist_war distutils command.

Using bdist_war is simple: just follow these instructions on the Pylons official docs: Pylons on Jython.

The WAR file contains everything you'll need: the Jython runtime and all the eggs your app requires. For Paste style apps, it can automatically generate a deployment descriptor (web.xml) to load the application via modjy (which is now included with Jython as of the beta2 release).

This makes deployment to a J2EE App server incredibly easy, even easier than deploying your app behind Apache or the like.

I'll be giving a talk on Pylons on Jython at PyCon '09 in a couple weeks. 

Monday, February 23, 2009

Pylons 0.9.7 released

After a lengthy release cycle (5 betas, 6 release candidates) the new Pylons 0.9.7 release is finished!

This release is huge:

o Optional SQLAlchemy and Genshi or Jinja2 integration for new projects, out of the box
o Support for Jython 2.5 (and support for Google App Engine with appengine-monkey, and even some success on PyPy)
o New extensive documentation, as well as the Pylons book (which is also available online)
o Now uses the awesome WebOb library
o New PylonsHQ website, powered by CouchDB

and a whole slew of new features and fixes. See the official release announcement for more details.

Thursday, January 15, 2009

New in Jython 2.5b1: elementtree, Java Integration overhaul

Sébastien Boisgérault's jython-elementtree project was incorporated into the recent Jython 2.5b1 release.

It doesn't implement any actual elementtree code, but instead provides a partial implementation of the pyexpat module (which the pure Python elementtree is built upon) in a clever 600 lines of Python code.

This provides full support for elementtree but also improves compatibility with code using pyexpat. For example, the standard lib's xmlrpclib module takes advantage of pyexpat for faster XML parsing if the module is provided. Jython may never fully support every pyexpat feature, but this is a great step towards supporting libraries like Genshi, among others.

Unfortunately jython-elementtree requires the latest Xerces: an additional 1mb jar. Xerces also seems to have also introduced some classpath issues, which is just about as cliche as you can get in Java.

The 2.5b1 release also includes an overhaul of Java Integration. It's now based on new style classes, which is very important going forward.