Trying to fix some compatible problems with django 1.6