def main(): if len(sys.argv) > 1: logging_level = LOGGING_LEVEL_MAP.get( str(sys.argv[1]).lower(), "error") else: logging_level = DEFAULT_LOGGING_LEVEL logging.basicConfig( format= "[%(asctime)s][%(levelname)s][%(filename)s:%(funcName)s:%(lineno)d] %(message)s", level=logging_level, ) print(f"Logging level set to: {logging_level}") import modules.app as app app.run()
from modules import app app.run(port=3000, debug=True)
from modules import app # # model = load_model("imagemodel.h5") # print("model loading .... plaese wait this might take a while") app.run(debug=False, host='127.0.0.1', port=5000)
from modules import app # from flask_basicauth import BasicAuth # # basic_auth = BasicAuth(app) # @app.route('/') # @basic_auth.required # def movieLog(): # return 'Movie Log!!!' if __name__ == '__main__': app.run(debug=True, port=4000)
# -*- coding: utf-8 -*- from modules import app, auth from sanic import response from modules.sanic_mysql import SanicMysql from config import db_settings app.static('/', './front-end/') @app.route("/test_api") async def test(request): return response.json({"hello": "world"}) app.config.update(dict(MYSQL=db_settings)) SanicMysql(app) if __name__ == "__main__": app.run(host="0.0.0.0", port=8000)
from modules import app if __name__ == "__main__": app.debug = True app.run(host="0.0.0.0")
from modules import app if __name__ == "__main__": app.debug=True app.run(host="0.0.0.0")
:param prf_name: websphere的概要文件名 :param srv_name: websphere的应用服务器名 :return: result: 收集结果 """ was_inven = request.args.get('was_inven', None, type=str) prf_name = request.args.get('prf_name', None, type=str) srv_name = request.args.get('srv_name', None, type=str) was_collect_cmd = "sh /zxyx/utils/call_py_getjc.sh \'{0}\' {1}".format( prf_name, srv_name) app.logger.debug(was_collect_cmd) collect_result = {} if PRODUCT: collect_result = ansible_collect(inventory_in=was_inven, collect_cmd_str=was_collect_cmd) #collect_result["stdout_lines"] = ["test1", "test2"] else: collect_result["stdout_lines"] = ["test1", "test2"] return jsonify(result='\n'.join(collect_result["stdout_lines"])) if __name__ == '__main__': #app.debug = True init_log() if PRODUCT: import sys reload(sys) sys.setdefaultencoding('utf-8') default_encoding = sys.getdefaultencoding() app.run(host='0.0.0.0')
from modules import app app.run(host='0.0.0.0', port=8080, debug=True)
#!/usr/bin/python # coding=utf-8 from modules import app if __name__ == '__main__': # run application server app.run("0.0.0.0", 8000)
from modules import app, REACT_DIR, MEDIA_DIR, TOURNAMENT_START from modules.models import user from modules.controllers import admins, brackets, sessions, users from modules.utils import catch_all, media # models user.initialize(app, MEDIA_DIR, TOURNAMENT_START) # controllers admins.initialize(app) brackets.initialize(app) sessions.initialize(app) users.initialize(app) # sends images from /media media.initialize(app, MEDIA_DIR) # sends the react app # make sure this is last catch_all.initialize(app, REACT_DIR) if __name__ == "__main__": app.run(host="0.0.0.0", debug=True)
from modules import app # # model = load_model("imagemodel.h5") # print("model loading .... plaese wait this might take a while") app.run(debug=False,host='192.168.1.103',port=5000)
from modules import app if __name__ == '__main__': app.run(debug=True,host='0.0.0.0')
from modules import app if __name__ == '__main__': app.run( host='127.0.0.1', port=8080 )
from modules import app app.config.from_object( 'configuration.ProductionConfig') # Y esta una opcion mas completa # app.config.from_pyfile('config.py') # Esta es una opcion mejor app.run() # debug=True entre los parentesis es una opcion # app.config['debug'] = True # esta es otra #app.debug = True # Y esta, otra
from modules import app app.secret_key = 'secret_key' app.run(host='0.0.0.0', port=5000, debug=True)
from modules import app if __name__ == '__main__': app.run(host='0.0.0.0', debug=True)
from modules import app # # model = load_model("imagemodel.h5") # print("model loading .... plaese wait this might take a while") app.run(debug=False, host='localhost', port=5000, threaded=False)
from modules import app if __name__ == '__main__': app.run(debug=False)
from modules import app # # model = load_model("imagemodel.h5") # print("model loading .... plaese wait this might take a while") #app.run(debug=False,host='localhost',port=5000, threaded = False) if __name__ == '__main__': app.run()
from modules import app if __name__ == '__main__': app.run(debug=True)
from modules import app if __name__ == "__main__": app.run()