Made some changes for the new version of Django