I’ve previously written about my delight at the Django error pages. Well, I’ve found something even better: the Werkzeug Debugger! It’s developed by the Pocoo Team, which has also given us Pygments (the python code hi-liter that seems to be used everywhere lately), Jinja (the Django style template library used by Sphinx), and several others that I haven’t had the time to investigate yet.
Why is the Werkzeug Debugger so good? It is because it seems to integrate perfectly with Django, and it gives you a command prompt right there in your browser window, giving you the freedom to investigate the program state at that stackframe. Pure technogasm material! It also gives you the entire contents of the file, with the current function and the offending line highlit. And finally, you can view just the traceback (and supposedlyu automatically paste it to the lodgeit pastebin — I didn’t get that to work).
To install simply
easy_install werkzeug
then use the 12-line script found here to run your local django server (instead of python manage.py runserver).
I’m a believing member in the church of emacs, and in honor of the new release I went looking for solutions to a couple of outstanding issues I’ve had with my emacs installation.
Today’s first emacs find is M-; which, although undocumented, works excellently to comment and uncomment code blocks in Python (it had puzzled me for a while that the comment-block command on the Python menu was C-c # and that there was no mapping for the uncomment command). The M-; command works in a plethora of other modes as well to comment and uncomment blocks.
The second emacs treasure I found today was how to turn on autocompletion. Not the mind-numbingly annoying kind that some editors have that pops up and obscures half your program whenever you type a key, but rather cycling through options when pressing M-RET. To enable it, simply put this in your .emacs file:
(define-key global-map (read-kbd-macro "M-RET") 'hippie-expand)
Searching for some info on hippie-expand, I ran into dabbrev-expand which is bound to M-/. I couldn’t tell you what the difference is, but the ESC-Enter combination is easier to find blindfolded so that’s what I’m going with.
I was checking out a number of 37signals’ webapps today (Highrise, Basecamp, and a few others… well worth a look). When I discovered I could sign in with OpenID. After a little googling and watching an excellent screencast over at Simon Willisons weblog, I figured out what it was and managed to turn my other site into an OpenID for myself. I might take a stab at implementing OpenID login for the site I’m working on, although it might not be the right audience… So what is it, you ask? Go watch the screencast, it explains it better than I ever could