Showing posts with label turbogears. Show all posts
Showing posts with label turbogears. Show all posts

March 14, 2008

Getting Started with Pylons/TurboGears 2: Modern Python Web Development

This presentation was as frustrating for me as it probably was for the presenters, Mark Ramm and Ben Bangert. Unfortunately the examples for the first part of the tutorial relied on having up to date copies of lots of packages, and the audience were unable to download them from the Internet as the hotel staff appeared to be having some difficulty connecting 500 geeks to the fat Internet pipe through their wireless infrastructure, and connectivity was extremely intermittent.

Things went from bad to worse when I finally managed to download the required software from the Internet and found that my examples failed: it turned out that only the presenters' machines had the necessary combination of packages. Consequently a lot of the first hour was wasted in trying to organize a thumb-drive bucket-brigade to ensure that all present had the needed stuff loaded. I can understand Mark's anxiousness to present the latest and greatest TurboGears to the audience, but I was there primarily because I wanted to get back into the technology so as to be able to make fair comparisons with Django.

While we were trying to get the load problems sorted out, mark talked about the WSGI interface and its role as a standard in the Python web world. He then talked us through a couple of practical applications, and I ended up with a simple server working based on the reference implementation, wsgiref. We then implemented the same functionality using cherrypy.wsgiserver, observing that the fundamental techniques weren't particularly different. The third exercise didn't actually add much for me, since we just had to get the existing servers to replace the initial output with a listing of the environment dictionary.

Then we moved on to TurboGears. Alas, I ended up typing in code from the handout while Mark was explaining the supporting functionality, and when all was said and done I didn't notice a lot that was new in terms of how you put a TurboGears application together. In one way this is very good, because it means that the TG re-implementation has retained the same API that its developers have become familiar with; in another it's bad, because I didn't feel I actually learned all that much as someone who had already put TG applications together, albeit small ones. Much of what was said was narrative about the state of the software rather than directed towards learning the technology. I didn't have the sample web finished, with nine pages remaining of the handout by the time Mark's part of the session was over.

Ben Bangert then proceeded to explain the differences in philosophy between TurboGears and Pylons. I'm sorry to say that my experience on the first rather-more-than-half of the tutorial left me unable to concentrate sufficiently, and I didn't absorb as much as I would have liked. I don't remember any practical work at all, and I didn't end up with a handout, but I don't know whether I missed it or what.

This was the first of a matched pair of tutorials, the second discussing advanced use of TG and Pylons. I didn't attend it because I was booked on something else in the evening session, so I hope that those who did found that this tutorial had provided them with the necessary background.

February 9, 2008

Live on Django

After some weeks of planning (our own site always takes second place to clients) I am happy to say that the holdenweb.com site is up and running on a new host as a Django site. Thanks to all those in the Django community who have provided help and advice over the past few weeks.

During the reorganization we also took the opportunity to polish up our standards compliance, and so as far as I know the whole site is now valid XHTML 1.0 Transitional. The server also now has a permanent redirect for requests for the www subdomain to the main domain, which will shorten most URLs by four characters and makes us no-www.org compliant at class B.



Not much else has changed yet, though you will notice that reloading a page now typically displays a different book. The next job is to reorganize the URLs, adding redirects for the existing ".html" locations and cleaning them up to be dotless (since there is no longer any static HTML in the site). We are excited by the possibilities.

Before undertaking this modest project I looked quite hard at both TurboGears and Django, and I have to say that both projects are so good the decision was quite difficult. In the end the thing that swung it for me was the ease of migration of the existing templates and database content. Had I been starting from scratch, however, I might have been tempted by TurboGears. I think that Django just fit my brain better on this one.