Updated for Django 1.6 compatibility

Tested with Django 1.6 / Python 3.4