Modified to work with python 3.3.2 and django 1.6b