def main(): if len(sys.argv) > 1: print backend(**add_args()) else: try: desc = __doc__.split('\n\n')[1].strip() parser = argparse.ArgumentParser(description=desc, epilog=epi) args = parser.parse_args() open_browser(app.config.get('PORT')) app.run(port=app.config.get('PORT')) sys.exit(0) except KeyboardInterrupt, e: # Ctrl-C raise e except SystemExit, e: # sys.exit() raise e
def main(): if len(sys.argv) > 1: sys.stdout.write(backend(**add_args())) else: try: desc = __doc__.split('\n\n')[1].strip() parser = argparse.ArgumentParser(description=desc, epilog=epi) args = parser.parse_args() open_browser(app.config.get('PORT')) app.run(port=app.config.get('PORT')) sys.exit(0) except KeyboardInterrupt as e: # Ctrl-C raise e except SystemExit as e: # sys.exit() raise e else: sys.stdout.write('ERROR, UNEXPECTED EXCEPTION') traceback.print_exc() os._exit(1)
import config from module import app, upload from flask import url_for, render_template, jsonify @app.route('/') def index(): return render_template('index.html', title="Flask Upload Demo") if __name__ == "__main__": app.run(host='0.0.0.0', port=5001, debug=config.DEBUG)
from module import app if __name__ == '__main__': app.run()
#!/usr/bin/python from module import app if __name__ == "__main__": app.run(debug=True,host='0.0.0.0',threaded=True)
from module import app from module.config import routes if __name__ == "__main__": app.run(debug=True)