Changed to comply with Django 1.5