'Standard entry point for processing requests in Django'

def process_request(self, request):

    if ((not hasattr(request, 'user')) or (not request.user.is_authenticated())):
        return
    timeout_in_seconds = getattr(settings, 'SESSION_INACTIVITY_TIMEOUT_IN_SECONDS', None)
    if timeout_in_seconds:
        utc_now = datetime.utcnow()
        last_touch = request.session.get(LAST_TOUCH_KEYNAME)
        if last_touch:
            time_since_last_activity = (utc_now - last_touch)
            if (time_since_last_activity > timedelta(seconds=timeout_in_seconds)):
                del request.session[LAST_TOUCH_KEYNAME]
                auth.logout(request)
                return
        request.session[LAST_TOUCH_KEYNAME] = utc_now
