from view import app import logging log = logging.getLogger('openid_connect_authenticator') log.setLevel(logging.DEBUG) fh = logging.FileHandler('openid_connect_authenticator.log') fh.setLevel(logging.DEBUG) log.addHandler(fh) formatter = logging.Formatter('%(asctime)s %(name)s %(levelname)s %(message)s') fh.setFormatter(formatter) log.info("Run server started") app.run(debug=True, host='0.0.0.0', threaded=True)
#coding=utf-8 #!/usr/bin/python from view import app #somewhere 表示的包含Flask的实例,如app = Flask(__name__) if __name__ == "__main__": app.run(debug=True)
from view import app # imports app to run the app routes from view if __name__ == "__main__": app.run(debug=True, host='127.0.0.1', port='5009') # main run engine of website # runs on LAN with port 8080
"""Driver for Web server""" from view import app if __name__ == "__main__": # runs the application on the repl development server app.run(debug=True, host='127.0.0.1', port='5001')
from view import app if __name__ == '__main__': app.run()
# -*- coding: utf-8 -*- # @Time 2020/6/1 9:24 # @Author wcy # -*- coding: utf-8 -*- from view import app if __name__ == '__main__': app.run(host="0.0.0.0", port=12345)
# encoding=utf-8 from view import app @app.after_request def add_header(r): r.headers["Cache-Control"] = "no-cache, no-store, must-revalidate" r.headers["Pragma"] = "no-cache" r.headers["Expires"] = "0" r.headers['Cache-Control'] = 'public, max-age=0' return r if __name__ == '__main__': app.run(host="0.0.0.0", port=8888, debug=False, processes=1)
# -*- coding: utf-8 -*- from view import app if __name__ == '__main__': app.run(host='127.0.0.1', port='8000')
from view import app if __name__ == "__main__": app.run(debug=True, use_reloader=True)
def main(): app.run(**RUN_CONFIG)
from view import app import logging log = logging.getLogger('openid_connect_authenticator') log.setLevel(logging.DEBUG) fh = logging.FileHandler('openid_connect_authenticator.log') fh.setLevel(logging.DEBUG) log.addHandler(fh) formatter = logging.Formatter('%(asctime)s %(name)s %(levelname)s %(message)s') fh.setFormatter(formatter) log.info("Run server started") app.run(debug=True, host='0.0.0.0', port=5001, threaded=True)
#!/usr/bin/env python #-*- coding:utf-8 -*- from view import app if __name__ == '__main__': app.run(host='192.168.70.88', port=8090, debug=True)
client = None db = None if 'VCAP_SERVICES' in os.environ: vcap = json.loads(os.getenv('VCAP_SERVICES')) print('Found VCAP_SERVICES') if 'cloudantNoSQLDB' in vcap: creds = vcap['cloudantNoSQLDB'][0]['credentials'] user = creds['username'] password = creds['password'] url = 'https://' + creds['host'] client = Cloudant(user, password, url=url, connect=True) db = client.create_database(db_name, throw_on_exists=False) elif os.path.isfile('vcap-local.json'): with open('vcap-local.json') as f: vcap = json.load(f) print('Found local VCAP_SERVICES') creds = vcap['services']['cloudantNoSQLDB'][0]['credentials'] user = creds['username'] password = creds['password'] url = 'https://' + creds['host'] client = Cloudant(user, password, url=url, connect=True) db = client.create_database(db_name, throw_on_exists=False) # On IBM Cloud Cloud Foundry, get the port number from the environment variable PORT # When running this app on the local machine, default the port to 8000 port = int(os.getenv('PORT', 8000)) if __name__ == "__main__": app.run(host='127.0.0.1',port=port,debug=True)
from view import app if __name__ == '__main__': # running on 0000 on 10001 port app.run('0.0.0.0', 10001)
from view import app app.run(debug=True)
from view.notes import view_notes from view.randomizer import view_rand ############################################################################### # Configuration ############################################################################### BASE_DIR = os.path.dirname(os.path.abspath(__file__)) DATABASE = os.path.join(BASE_DIR, 'flaskr.db') DEBUG = True SECRET_KEY = os.urandom(25) CSRF_ENABLED = True HOST = '0.0.0.0' PORT = 8080 MAX_NOTES_ON_PAGE = 10 MAX_USERS_ON_PAGE = 20 # cache = Cache(app,config={'CACHE_TYPE': 'simple'}) # tools = DebugToolbarExtension(app) app.config.from_object(__name__) app.root_path = os.path.dirname(os.path.abspath(__file__)) app.register_blueprint(view_auth) app.register_blueprint(view_errors) app.register_blueprint(view_notes) app.register_blueprint(view_rand) ############################################################################### if __name__ == '__main__': app.run(host=app.config['HOST'], port=app.config['PORT'])