Fixes for Django 1.6

Allow to run with Django 1.6