Adding Django 1.6 support

With my changes work again with Django 1.6