I'm trying to redirect to the login page when the cookie expires but it's not working.
It's supposed to be as simple as adding these lines to settings.py:
LOGIN_URL = '/login/'
Something in your code is trying to import
redirect_to, which was removed in Django 1.5. You need to find this code and update it.