import os from server.app import app import param os.chdir(os.path.dirname(os.path.realpath(__file__))) print("starting server on http://" + param.localServerName + ":" + str(param.localServerPort)) test = True # fix bidon pour reload l'app à la modif sinon ça bug if test: while True: try: app.run(host=param.localServerName, port=param.localServerPort, debug=True) except SystemExit: pass else: app.run(host=param.localServerName, port=param.localServerPort, debug=True) print("done")
from server.app import app if __name__ == '__main__': app.run(host='0.0.0.0', debug=app.config['DEBUG'])
from server.app import app if __name__ == '__main__': print("Running server") app.run(host='0.0.0.0', port="5000")
from set_env import setup_env setup_env() from server.app import app if __name__ == "__main__": app.run(debug=True, port=5000)
#!/usr/bin/env python from server.app import app if __name__ == '__main__': app.run(port=6900, debug=True)
#!/usr/bin/env python """ Runs the backend server """ from flask import Flask from server.app import app if __name__ == '__main__': app.run(host='0.0.0.0', port=app.config['PORT'])
from server.app import app import ssl if __name__ == "__main__": ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLS) ssl_context.load_cert_chain(certfile="ssl/certificate.crt", keyfile='ssl/private.key') app.run(host="0.0.0.0", port=5000, threaded=True, debug=True, ssl_context=ssl_context)
# coding=utf-8 from flask.ext.jwt import JWT from server import root_blueprint from server.app import app from server.bands import band_blueprint from server.vote import vote_blueprint, track_blueprint # this file is only for local testing # in a productive environment this is # i.e. ~/fcgi-bin/tunefish-beta from server.vote.jwt import identity, authenticate, jwt_request_handler jwt = JWT(app, authenticate, identity) jwt.request_handler(jwt_request_handler) app.register_blueprint(band_blueprint, url_prefix='/bands') app.register_blueprint(vote_blueprint, url_prefix='/vote') app.register_blueprint(track_blueprint, url_prefix='/vote') app.register_blueprint(root_blueprint, url_prefix='') if __name__ == '__main__': app.run(threaded=True, host='0.0.0.0')
def start(self): app.run(host=self.server_address, port=self.port)
from server.app import app if __name__ == "__main__": app.run( host=app.config['HOST'], port=app.config['PORT'], debug=app.config['DEBUG_MODE'])
from server.app import app if __name__ == "__main__": app.run(host="0.0.0.0", port=8080, threaded=True, debug=False)
import yaml import sys sys.path.append("src") from server.app import app if __name__ == "__main__": app.run(debug=True, host='0.0.0.0')
def main(): app.run(debug=True)
from server.app import app if __name__ == '__main__': app.run(debug=True)
# -*- coding: utf-8 -*- # @Author: ioriiod0 # @Date: 2017-07-12 11:47:28 # @Last Modified by: ioriiod0 # @Last Modified time: 2017-07-14 19:21:37 import sys sys.path.append("..") import gevent from gevent.monkey import patch_all from conf import * ''' gevent是第三方库,通过greenlet实现协程,其基本思想是: 当一个greenlet遇到IO操作时,比如访问网络,就自动切换到其他的greenlet,等到IO操作完成,再在适当的时候切换回来继续执行。 由于IO操作非常耗时,经常使程序处于等待状态,有了gevent为我们自动切换协程,就保证总有greenlet在运行,而不是等待IO。 由于切换是在IO操作时自动完成,所以gevent需要修改Python自带的一些标准库,这一过程在启动时通过monkey patch完成: ''' patch_all() from server.app import app if __name__ == '__main__': app.run(debug=True, host=http_host, port=http_port)
import os, sys from server.app import app if (sys.version_info[0] == 2): raise RuntimeError("python2 not supported") port = 4200 if "PORT" in os.environ: port = int(os.environ["PORT"]) app.run(host='localhost', port=port)
from server.app import app import config if __name__ == "__main__": if config.DEV_MODE: app.run(debug=True) else: app.run(host="0.0.0.0", port=8080)
from server.app import app if __name__ == '__main__': app.run(debug=app.config['DEBUG'], host='0.0.0.0', port=3001)
from server.app import app if __name__ == '__main__': app.run(port=8000)
#!./__venv__/bin/python3.6 import logging from server.app import app logger = logging.getLogger(__name__) if __name__ == "__main__": logger.info('Listening on http://0.0.0.0:%d', app.config['SERVER_PORT']) app.run(host='0.0.0.0', port=app.config['SERVER_PORT'])
from server.app import app, db from server.models import * if __name__ == '__main__': with app.app_context(): db.create_all() # setting host to 0.0.0.0 to access the site on local ip addresses (ifconfig) app.run(host='0.0.0.0', port=8080, debug=True)
def runServer(port): serverApp.register_blueprint(placer_blueprint, url_prefix='/placer') serverApp.register_blueprint(authenticator_blueprint, url_prefix='/authenticator') serverApp.run(port=port)
#coding: utf-8 from server.app import app if __name__ == '__main__': app.run(host='0.0.0.0')
from server.app import app if __name__ == '__main__': app.run()
from server.app import app if __name__ == "__main__": app.run(host=app.config['HOST'], port=app.config['PORT'], debug=app.config['DEBUG_MODE'])
import os from server.app import app if __name__ == "__main__": port = int(os.environ.get('PORT', 5000)) app.run(host='0.0.0.0', port=port)
def main(): app.run(debug=True, host='0.0.0.0', port=80)
from config.settings import SERVER_HOST, SERVER_PORT from server.app import app if __name__ == '__main__': app.run(SERVER_HOST, SERVER_PORT)
#!/usr/bin/python3 from server.app import app as application if __name__ == "__main__": application.run(host='0.0.0.0')
import os from server.app import app app.yapapi_executor_config = { # NOTE: budget == 10 is not enough to make it run for long 'budget': 10, 'subnet_tag': os.environ.get('SUBNET_TAG', 'erigon'), } if __name__ == '__main__': app.run(host='0.0.0.0')
from server.app import app import os if __name__ == "__main__": # Get Heroku port, fall back to port 5000 port = int(os.environ.get("PORT", 5000)) app.run(host="0.0.0.0", port=port)
def main(): app.run(host='0.0.0.0', port=8080, debug=True)
from server.app import app from server.config import config from server.api import api # Note, this file exists because I was having issues with module levels # imports working in app.py for both flask and celery api.init_app(app) if __name__ == '__main__': if config["IN_DOCKER"]: print('Starting server with docker settings') app.run(port="5000", host="0.0.0.0") else: print( 'Starting server with local execution settings, please be sure to use port 5005' ) app.run(debug=True, port="5005")