'Save the initial referer'

def get(self, request, *args, **kwargs):

    self.referer = request.META.get(u'HTTP_REFERER', u'')
    request.session[u'login_referer'] = self.referer
    return UpdateView.get(self, request, *args, **kwargs)
