Django 1.7 compatibility.
Merge Django 1.7 compatibility