Django 1.7 compatibility added

Find the answer how do compatibility with Django 1.7 in this ticket (https://code.djangoproject.com/ticket/22872).