def METHOD_NAME(last_step=None):
    """
    Main logic for the module. It allows for restarting the
    initialization at any point if one of the modules should crash.
    Args:
        last_step (str, None): The last stored successful step, for starting
            over on errors. None if starting from scratch. If this is 'done',
            the function will exit immediately.
    """
    if last_step in ("done", -1):
        # this means we don't need to handle setup since
        # it already ran sucessfully once. -1 is the legacy
        # value for existing databases.
        return
    # setup sequence
    setup_sequence = {
        "create_objects": create_objects,
        "at_initial_setup": at_initial_setup,
        "collectstatic": collectstatic,
        "done": reset_server,
    }
    # determine the sequence so we can skip ahead
    steps = list(setup_sequence)
    steps = steps[steps.index(last_step) + 1 if last_step is not None else 0 :]
    # step through queue from last completed function. Once completed,
    # the 'done' key should be set.
    for stepname in steps:
        try:
            setup_sequence[stepname]()
        except Exception:
            # we re-raise to make sure to stop startup
            raise
        else:
            # save the step
            ServerConfig.objects.conf("last_initial_setup_step", stepname)
            if stepname == "done":
                # always exit on 'done'
                break