'This attempts to run the initial_setup script of the server.
It returns if this is not the first time the server starts.
Once finished the last_initial_setup_step is set to -1.'

def run_initial_setup(self):

    last_initial_setup_step = ServerConfig.objects.conf('last_initial_setup_step')
    if (not last_initial_setup_step):
        print('    Server    started    for    the    first    time.    Setting    defaults.')
        initial_setup.handle_setup(0)
        print(('-' * 50))
    elif (int(last_initial_setup_step) >= 0):
        print(('    Resuming    initial    setup    from    step    %(last)s.' % {'last': last_initial_setup_step}))
        initial_setup.handle_setup(int(last_initial_setup_step))
        print(('-' * 50))
