Django v1.3

Added some extra changes to add support for Django v1.3.x