def get_user_hash(request):
 ip = request.META.get('REMOTE_ADDR', '')
 ua = request.META.get('User-Agent', '')
 session_key = (request.session.session_key or '')
 return hashlib.sha1('-'.join(map(str, (ip, ua, session_key)))).hexdigest()

def get_user_hash ( request ) : ip = request . META . get ( 'REMOTE_ADDR' , '' ) ua = request . META . get ( 'User-Agent' , '' ) session_key = ( request . session . session_key or '' ) return hashlib . sha1 ( '-' . join ( map ( str , ( ip , ua , session_key ) ) ) ) . hexdigest ( )
get a hash identifying an user .