Adds support for django 1.6 without breaking previous versions.