from hello import app as application if __name__ == '__main__': application.run(host='0.0.0.0', debug=True)
# -*- coding: utf-8 -*- from hello import app if __name__ == "__main__": app.run(host='0.0.0.0', port=5000)
#-*- coding:utf-8 -*- from hello import app if __name__ == "__main__": app.run(port=1234, debug=True)
from gevent import monkey monkey.patch_all() import os virtenv = os.environ["OPENSHIFT_PYTHON_DIR"] + "/virtenv/" virtualenv = os.path.join(virtenv, "bin/activate_this.py") try: # See: http://stackoverflow.com/questions/23418735/using-python-3-3-in-openshifts-book-example?noredirect=1#comment35908657_23418735 # execfile(virtualenv, dict(__file__=virtualenv)) # for Python v2.7 # exec(compile(open(virtualenv, 'rb').read(), virtualenv, 'exec'), dict(__file__=virtualenv)) # for Python v3.3 # Multi-Line for Python v3.3: exec_namespace = dict(__file__=virtualenv) with open(virtualenv, "rb") as exec_file: file_contents = exec_file.read() compiled_code = compile(file_contents, virtualenv, "exec") exec(compiled_code, exec_namespace) except IOError: pass from gevent.wsgi import WSGIServer from hello import app ip = os.environ["OPENSHIFT_PYTHON_IP"] port = int(os.environ["OPENSHIFT_PYTHON_PORT"]) app.run(host=ip, port=port, server="gevent")
#! /usr/bin/env python # -*- coding: utf8 -*- from hello import app as application if __name__ == "__main__": application.run()
from hello import app if __name__ == "__main__": app.run(host="0.0.0.0")
from hello import app as application if __name__ == "__main__": application.run()
from hello import app, db if __name__ == '__main__': db.create_all() app.run(debug=True)
from hello import app if __name__ == '__main__': app.run(debug=True, host='127.0.0.1', port=2000)
from hello import app import os if __name__ == '__main__': app.run(debug=True, port=8080, host=os.environ["IP"])
import sys sys.path.append("/usr/local/lib/python2.7/site-packages/") from hello import app if __name__ == "__main__": listen_on = "8080" app.run(port=listen_on)
from hello import app if __name__ == '__main__': app.run('0.0.0.0', port=8080)
def run(): app.run()
from hello import app, db if __name__ == '__main__': db.create_all() #app.run(debug=True) app.run(host='0.0.0.0', port=8080)
#!/usr/bin/python3 # -*- coding: utf-8; mode: python -*- from hello import app app.run(host="0.0.0.0", port=8181, debug=True)
from hello import app, db if __name__ == '__main__': db.create_all() app.run(host='0.0.0.0')
from os import environ from hello import app app.run(port=environ.get('PORT', 5000))
from hello import app if __name__ == "__main__": app.run()
def run(): print('服务器跑起来了') app.run(debug=True)
from hello import app, db, views, models # 서버 실행 if __name__ == '__main__': app.run()
from hello import app as application if __name__ == "__main__": application.run(host="0.0.0.0")