Add proper Django 1.5 support

Added proper support for Django 1.5 as the other pull requests weren't fixing the compatibility issues properly