Django 1.7 compatibility

[Contrib middleware removed from default MIDDLEWARE_CLASSES](http://django.readthedocs.org/en/latest/releases/1.7.html#contrib-middleware-removed-from-default-middleware-classes)