def get_user_ip(request):
    """ Get the ipaddress of the user """
    ipaddress = request.environ.get('REMOTE_ADDR', None)
    if 'X-Forwarded-For' in request.headers.keys():
        ipaddress = request.headers['X-Forwarded-For']
    return ipaddress
