def main(): """Main function""" parser = argparse.ArgumentParser(description=NAME) parser.add_argument('--host', '-H', dest='host', type=str, default=HOSTNAME, required=False, help='Host') parser.add_argument('--port', '-P', dest='port', type=int, default=PORT, required=False, help='Port') parser.add_argument('--debug', '-D', dest='debug', action='store_true', required=False, help='Debug mode') args = parser.parse_args() app.run(host=args.host, port=args.port, debug=args.debug, threaded=True)
def serve(server='127.0.0.1', port=5000, debug=True): """ Serves this site. """ if not debug: import logging file_handler = logging.FileHandler("error.log") file_handler.setLevel(logging.WARNING) app.logger.addHandler(file_handler) #asset_manager.config['ASSETS_DEBUG'] = debug app.debug = debug app.run(host=server, port=port, debug=debug)
def serve(server="127.0.0.1", port=5000, debug=True): """ Serves this site. """ if not debug: import logging file_handler = logging.FileHandler("error.log") file_handler.setLevel(logging.WARNING) app.logger.addHandler(file_handler) # asset_manager.config['ASSETS_DEBUG'] = debug app.debug = debug app.run(host=server, port=port, debug=debug)
def runserver(): """Runs the Flask server""" if app.debug: app.run(host=app.config['HOST'], port=app.config['PORT']) else: app.wsgi_app = ProxyFix(app.wsgi_app) address = app.config['HOST'], app.config['PORT'] server = WSGIServer(address, app) try: print("Server running on port %s:%d. Ctrl+C to quit" % address) server.serve_forever() except KeyboardInterrupt: server.stop() print("\nBye bye")
from website.app import app if __name__ == '__main__': app.run(debug=True)
from website.config import PORT, HOST from website.app import app import website.api import website.routes app.run(port=PORT, host=HOST)
from website.app import app if __name__ == '__main__': app.run('0.0.0.0', port=5000, debug=True)
from website.app import app if __name__ == "__main__": #create_table() app.run(host='0.0.0.0', debug=True)
from website.app import app if __name__ == "__main__": app.run()