'Get parameters to log in OPERATION_LOG.'

def _get_parameters_from_request(self, request, exception=False):

    user = request.user
    referer_url = None
    try:
        referer_dic = urlparse.urlsplit(urlparse.unquote(request.META.get('HTTP_REFERER')))
        referer_url = referer_dic[2]
        if referer_dic[3]:
            referer_url += ('?' + referer_dic[3])
        if isinstance(referer_url, str):
            referer_url = referer_url.decode('utf-8')
    except Exception:
        pass
    return {'client_ip': request.META.get('REMOTE_ADDR', None), 'domain_name': getattr(user, 'domain_name', None), 'domain_id': getattr(user, 'domain_id', None), 'project_name': getattr(user, 'project_name', None), 'project_id': getattr(user, 'project_id', None), 'user_name': getattr(user, 'username', None), 'user_id': request.session.get('user_id', None), 'request_scheme': request.scheme, 'referer_url': referer_url, 'request_url': urlparse.unquote(request.path), 'method': (request.method if (not exception) else None), 'param': self._get_request_param(request)}
