Updated django backend to be ready for Django 1.7.