Compatibility for Django 1.7
Merge master Django 1.7 compatibility