Django 1.4 compatibility adaptions
starting upgrade to Django 1.6