Note: This isn't a programming tutorial. If you're looking for a tutorial because you want to learn Pyramid on your own, head over to the Tutorials section in the offical Pyramid docs.
Recently, the University of Coimbra in Portugal rolled out a shiny new collection of web apps for students and staff. Users can now access through a single platform:
- their email account
- a personalized calendar
- a homepage app where they can manage their own online presence
- their profile, as it's stored in the uni's LDAP, which they can update
- a central panel to manage subscriptions to all Mailman mailing lists available to them
- a help desk application that integrates with the Request Tracker ticket-tracking system
- an application to access documents in the KnowledgeTree document management system
The apps are demoed (rather quickly) in this Portuguese language video. Skip to 1:23 to see them in action:
(Click here if you don't see the video.)
Mario José Bernardes, the project coordinator, draws a diagram that visualizes the different components involved under the hood:
And what you can see here is in fact implemented as a WSGI pipeline. The three boxes AP1 to AP3 at the bottom are the WSGI apps. In front of that we have PA which is a repoze.who based middleware that provides user authentication and single sign-on through Shibboleth and LDAP. And at the top there is a Deliverance middleware that provides the look & feel as well as the header and footer for all pages, including the menu to navigate between the apps.
Now what's really remarkable about this project, apart from its brilliant execution, is that it was developed mostly in-house by a small team of developers and admins, most of who hardly knew Python before they started the project.
How did they end up using Python and Pyramid?
The university is a long-time Silva user, using it for their public website for four years now, and they're very happy with it. They knew that they like Python and wanted to use it to solve more problems.
And that's when I got involved. Back in December '09, I was asked to do two Python tutorial sessions with three days each. The trainees were the in-house developers and most of them complete Python newbies. So the first half of the tutorial was an introduction to Python from the ground up and the second half explained WSGI, Paste and Pyramid (which was still repoze.bfg back then).
In parallel to the training sessions, we put our heads together to think about how a Python implementation of their envisioned web apps portal could look like. Back home from Portugal, I went ahead and wrote some of the core utilities and one example app that could be used as a reference point for programmers writing other apps.
And then it happened: After I delivered the first app, things got very silent. I stopped getting calls, no more emails, not even a single postcard! ... until I realized: the team didn't need me anymore. Python and Pyramid were too damn easy! My days as a consultant would soon be counted. :-)
- Don't teach Pyramid, you'll become useless soon
- Instead recommend hard-to-learn frameworks, or better yet, vendor-tied and hard-to-install black boxes
- Find a new job quick before more people find out about Pyramid
Seriously, what more important metric do we have for choosing one framework over another if not that: How long does it take your team to learn it and be productive with it?
Who did it
These guys rocked apps.uc.pt: Mario José Bernardes, Valentim Branquinho, João Santos, Hugo Branquinho, Pedro Pinheiro, Pedro Almeida and myself.