def poll_until_localhost_is_established(time_sleep_step, max_time):
    django_reachable = False
    current_time = 0
    while ((not django_reachable) and (current_time <= max_time)):
        try:
            requests.get(CREATE_USER_URL)
            django_reachable = True
        except:
            time.sleep(time_sleep_step)
            current_time += time_sleep_step
def poll_until_localhost_is_established(time_sleep_step, max_time):
    django_reachable = False
    current_time = 0
    while ((not django_reachable) and (current_time <= max_time)):
        try:
            requests.get(CREATE_USER_URL)
            django_reachable = True
        except:
            time.sleep(time_sleep_step)
            current_time += time_sleep_step