Posts Tagged ‘app engine’

Django SVN on Google App Engine

Sunday, January 4th, 2009

The Google How-To for using a version of Django other than the built in 0.96 appears to be a bit out of date, as signal handling has changed since the writing. Here’s what needs to be changed:

NOTE: These changes apply to this document dated April 2008. If the date at the top of the document is different, the how-to may have been updated since the writing of this post. Django Rev 9699 is what I’m using.

The main.py portion of the how-to says that two signal handlers need to be changed. Here’s the original source:

# 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)

Since the writing of the how-to, the connect and disconnect methods have been moved to the Signal object itself; the legacy functions have been removed (see diff). The code SHOULD be:
# Log errors.
django.core.signals.got_request_exception.connect(log_exception)

Unregister the rollback event handler.

django.core.signals.got_request_exception.disconnect(     django.db._rollback_on_exception)

TADA! Your shit should work on at least revision 9699 of Django.