manager = Manager(app)

def crazy_call():
    print('crazy_call')

@manager.command
def runserver():
    app.run()
crazy_call()
if __name__ == '__main__':
    manager.run()
Run code after flask application has started