Fix imports that are incompatible with Django 1.6