当前位置: 首页>>代码示例>>Python>>正文


Python app.run函数代码示例

本文整理汇总了Python中server.app.run函数的典型用法代码示例。如果您正苦于以下问题:Python run函数的具体用法?Python run怎么用?Python run使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了run函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: runserver

def runserver():
    if len(sys.argv) > 1:
        portNum = sys.argv[1]
    else:
        portNum = '8000'
    port = int(os.environ.get('PORT', portNum))
    app.debug = True
    app.run(host='0.0.0.0', port=port)
开发者ID:raptoria,项目名称:react-flask-boilerplate,代码行数:8,代码来源:runserver.py

示例2: server

def server(config):
    set_config(config)
    from server import app
    port = int(os.environ.get("RECAST_FRONTEND_PORT", 5000))

    ssl_kwargs = dict(
		ssl_context = (os.environ['RECAST_SSL_CERT'],os.environ['RECAST_SSL_KEY'])
	) if os.environ.get('RECAST_SSL_ENABLE',True) else {}

    app.run(host='0.0.0.0', port=port, threaded = True, **ssl_kwargs)
开发者ID:recast-hep,项目名称:recast-flask-frontend,代码行数:10,代码来源:frontendcli.py

示例3:

#!/usr/bin/env python
# -*- coding: utf-8 -*-
# author: le4f.net
from server import app
#如应用于生产环境 app.run(host='0.0.0.0', port=80) 并注意可能存在的安全隐患.
#有些情况下 localhost 会出问题,本地需要添加一个 hosts 。
if __name__ == '__main__':
	app.run(host='127.0.0.1', port=8080, debug=True)
开发者ID:QardenEden,项目名称:pcap-analyzer,代码行数:8,代码来源:app.py

示例4: main

def main():
    try:
        app.run(host=CONFIG['host'], debug=CONFIG['debug'], port=CONFIG['port'])
    except KeyboardInterrupt:
        sys.exit(0)
开发者ID:Minizza,项目名称:ghome,代码行数:5,代码来源:runserver.py

示例5:

# The entry point for the server

from server import app
import json
settings = json.load(open('config.json'))

app.run(debug=settings.get('debug', False), host=settings.get('host', '0.0.0.0'))
开发者ID:Riizade,项目名称:Dota-2-Market-Browser,代码行数:7,代码来源:main.py

示例6:

from server import app

app.run(port=5000, debug=True)
开发者ID:iShaVas,项目名称:Toto,代码行数:3,代码来源:run.py

示例7:

#!/usr/bin/python

from server import app, manager

if __name__ == '__main__':
    app.run(debug = True, host="0.0.0.0", threaded=True)
开发者ID:fehlfarbe,项目名称:UnsichtbarerFaden,代码行数:6,代码来源:run.py

示例8:

from server import app
import os

if __name__ == '__main__':
    port = os.getenv('NEWSPAPER_PORT', '38765')
    app.run(port=int(port), host='0.0.0.0')
开发者ID:Smarp,项目名称:newspaper-api,代码行数:6,代码来源:wsgi.py

示例9: run_server

def run_server():
    """
    Run the demo server.
    """
    app.run(debug=True, port=5001)
开发者ID:frnsys,项目名称:kalama,代码行数:5,代码来源:main.py

示例10: server

def server(config):
    set_config(config)
    from server import app
    port = int(os.environ.get("RECAST_PORT", 5000))
    app.run(host='0.0.0.0', port=port, ssl_context = (os.environ['RECAST_SSL_CERT'],os.environ['RECAST_SSL_KEY']) )
开发者ID:recast-hep,项目名称:recast-rest-api,代码行数:5,代码来源:apicli.py

示例11:

# -*- coding:utf-8 -*-
import socket

# fetch local ip address
localhost = socket.gethostbyname(socket.gethostname())
print localhost

from server import app as application

if __name__ == "__main__":
    application.run(host=localhost, debug=True)
开发者ID:wingjay,项目名称:jianshi,代码行数:11,代码来源:runserver.py

示例12:

from server import app as application
from config import HOST, \
                   PORT, \
                   DEBUG

if __name__ == '__main__':
    application.run(host=HOST,
            port=PORT,
            debug=DEBUG)

开发者ID:arcolife,项目名称:digGit,代码行数:9,代码来源:wsgi.py

示例13:

#!/usr/bin/env python
# -*- coding: utf-8 -*-
# author: le4f.net
from server import app
#如应用于生产环境 app.run(host='0.0.0.0', port=80) 并注意可能存在的安全隐患.
if __name__ == '__main__':
	app.run(host='localhost', port=8080, debug=True)
开发者ID:idkwim,项目名称:pcap-analyzer,代码行数:7,代码来源:app.py

示例14:

#! /usr/bin/env python
#-*- coding: utf-8 -*-

from server import app

if __name__ == '__main__':
    app.run('0.0.0.0', 23300, debug=True)
开发者ID:GradPaul,项目名称:GradPaul,代码行数:7,代码来源:app.py

示例15:

#
#  Unless required by applicable law or agreed to in writing, software
#  distributed under the License is distributed on an "AS IS" BASIS,
#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#  See the License for the specific language governing permissions and
#  limitations under the License.
#


#!/usr/bin/env python
from server import app, db

if __name__ == "__main__":
    # print app
    # print app.config['SQLALCHEMY_DATABASE_URI']
    app.debug = True
    db.create_all(app=app)
    app.run(host='0.0.0.0',port=5002, debug=True)

# if __name__ == "__main__":
# 	from cherrypy import wsgiserver
#
# 	db.create_all(app=app)
# 	# app.run(host='0.0.0.0',port=5000, debug=True)
# 	d = wsgiserver.WSGIPathInfoDispatcher({'/': app})
# 	server = wsgiserver.CherryPyWSGIServer(('0.0.0.0', 5001), d)
# 	try:
# 		server.start()
# 	except KeyboardInterrupt:
# 		server.stop()
开发者ID:ddinsight,项目名称:dd-analytics,代码行数:30,代码来源:run.py


注:本文中的server.app.run函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。