Compatibility with Django 1.5+

Compatibility with Django 1.5 and 1.6