How does one perform the following (Django 0.96) dispatcher hooks in Django 1.0?
import django.dispatch.dispatcher
def log_exception(*args, **kwds):
logging.exception('Exception in request:')
# Log errors.
django.dispatch.dispatcher.connect(
log_exception, django.core.signals.got_request_exception)
# Unregister the rollback event handler.
django.dispatch.dispatcher.disconnect(
django.db._rollback_on_exception,
django.core.signals.got_request_exception)
Incidentally, this code is from Google's Article on Using Django on GAE. Unfortunately the dispatch code in Django was rewritten between 0.96 and 1.0, and Google's example does not work with Django 1.0.
Of course, the Django people provided a helpful guide on how to do exactly this migration, but I'm not keen enough to figure it out at the moment. :o)
Thanks for reading.
Brian