• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python app.run函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: installed

############################
#Very basic python app to start the server.
#Can be used locally for testing.
#To compile the app, use 'export FLASK_APP=instant_server.py'
#The app can then be run using python 'python instant_server.py'
#It requires to have all the python requirements installed ('pip install requirements.txt')
##############################

import os
from server import app, db

if __name__ == '__main__':
    port = int(os.environ.get('PORT', 5000))
    debug = (port == 5000 or port == 8000)
    if debug:
        #A local database is used for testing
        #app.config['MONGODB_SETTINGS'] = {'db': 'local_db', 'host':'mongodb://localhost/test'}
        app.config['MONGODB_DB'] = 'local_db'
        app.config['MONGODB_HOST'] = 'mongodb://localhost/test'
        print('Debug mode is enabled. local_db used')
    app.run(host='0.0.0.0', port=port, debug=debug) #run() should not be used for production. Instead, gunicorn should be used in the procfile
开发者ID:clement91190,项目名称:cdj_website,代码行数:21,代码来源:instant_server.py


示例17:

from server import app

if __name__=="__main__":
    app.run('0.0.0.0', debug=True)
开发者ID:NKeerthiPrasad,项目名称:Semi-supervised-Causality-Extractor,代码行数:4,代码来源:runserver.py


示例18:

from server import app as application

if __name__ == '__main__':
    application.run(host='0', port=4444, debug=True)
开发者ID:aic513,项目名称:Guitar-Project,代码行数:4,代码来源:run.py


示例19:

from server import app
from settings import debug
app.debug = debug
app.run(host='0.0.0.0')
开发者ID:baali,项目名称:khuli-hawa,代码行数:4,代码来源:run.py


示例20:

from server import app
app.run(host='0.0.0.0', debug = True)
开发者ID:AkarshES,项目名称:Final-Sem-Project,代码行数:2,代码来源:runserver.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python app.test_client函数代码示例发布时间:2022-05-27
下一篇:
Python action.Action类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap