#!/usr/bin/env python from backend import app, socketio if __name__ == "__main__": #app.run(debug=True, use_reloader=False, port=5005) #socketio.run(app, debug=True, use_reloader=False, port=5005) socketio.run(app, debug=False, use_reloader=False, port=5005)
return (url, default_port) elif (len(a) == 2): return (a[0], int(a[1])) else: raise ValueError(url) def parse_arguments() -> SimpleNamespace: import argparse parser = argparse.ArgumentParser(description='''My app''') parser.add_argument("-b", "--bind", action='store', default="0.0.0.0:8080", help='binding address') parser.add_argument('-v', '--verbose', action='store_true', help='verbose') args = parser.parse_args() ip, port = split_url(args.bind, default_port=8080) return SimpleNamespace(bind_ip=ip, bind_port=port, verbose=args.verbose) if __name__ == '__main__': args = parse_arguments() if args.verbose: logging.basicConfig(level=logging.DEBUG) from backend import app, socketio socketio.run(app, host=args.bind_ip, port=args.bind_port, use_reloader=True, debug=True)
from backend import app, socketio if __name__ == "__main__": socketio.run(app, debug=True)
from backend import app, socketio if __name__ == '__main__': #app.run('0.0.0.0', 5000) socketio.run(app, host='0.0.0.0', port=5000)
from backend import app from backend import socketio if __name__ == '__main__': app.debug = True socketio.run(app, port=5000, debug=True)