Monday 7 November 2005 — This is nearly 19 years old. Be careful.
I’m only just beginning to dig into all of the Python web frameworks (The Boston Python Meetup group is doing a quickie comparison of frameworks on Thursday, and I’m on the hook for a TurboGears application.) For the most part, I still don’t understand what all the parts are, though I recognize the names going by in my RSS feeds. I read about the developments with a vague interest, because it doesn’t apply to me.
But when I saw Ian Bicking’s Ajaxy Exception Catching screencast, my mouth dropped open. He’s built something (WSGI middleware, what the heck is that?) that catches exceptions in your web application, and displays a stack trace in your browser. Big deal. But you can also expand the line numbers to see context lines of code around the lines themselves. Nice. Then you can expand some more to see all of the local variables at each frame in the stack. Whoa! Then you can type arbitrary Python into an edit control and have it evaluated in the context of that frame. Magic!!
Comments
In the end it's mostly just a function call wrapping another function call (like decorators typically do), with a try:except: to catch errors. My function then is invoked inbetween the server and your app -- hence the "middle" in "middleware".
Add a comment: