本文整理汇总了Python中webapp.app.run函数的典型用法代码示例。如果您正苦于以下问题:Python run函数的具体用法?Python run怎么用?Python run使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了run函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: run
def run(self):
logger.info('starting webapp')
logger.info('hosted at %s' % settings.WEBAPP_IP)
logger.info('running on port %d' % settings.WEBAPP_PORT)
app.run(settings.WEBAPP_IP, settings.WEBAPP_PORT)
开发者ID:scalextremeinc,项目名称:skyline,代码行数:7,代码来源:webapp.py
示例2: debug
def debug(args):
port = int(args.port)
data_path = utility.abspath(args.json)
utility.check_file(data_path)
app.config["DATA_PATH"] = data_path
app.config["SECRET_KEY"] = "development key"
app.run(debug=True, port=port)
开发者ID:kenbeese,项目名称:DataProcessor,代码行数:7,代码来源:utils.py
示例3: run
def run():
"""Starts local development server"""
from webapp import app
from werkzeug.serving import run_simple
if app.debug:
run_simple('0.0.0.0', 5000, app,
use_reloader=True, use_debugger=True, use_evalex=True)
else:
app.run(host='0.0.0.0')
开发者ID:imiric,项目名称:flask-scaffold,代码行数:10,代码来源:fabfile.py
示例4: start
def start(args):
port = int(args.port)
log_path = args.logfilepath
lock_path = args.lockfile
data_path = utility.abspath(args.json)
utility.check_file(data_path)
app.config["DATA_PATH"] = data_path
app.config["SECRET_KEY"] = "development key"
if not op.exists(lock_path):
dc = DaemonContext(pidfile=PIDLockFile(lock_path),
stderr=open(log_path, "w+"),
working_directory=ROOT)
with dc:
app.run(port=port)
else:
raise exception.DataProcessorError("Server already stands.")
开发者ID:kenbeese,项目名称:DataProcessor,代码行数:16,代码来源:utils.py
示例5: run
def run(argc, argv):
parser = argparse.ArgumentParser(
description='Iposonic is a SubSonic compatible streaming server.'
+ 'Run with #python ./main.py -c /opt/music')
parser.add_argument('-c', dest='collection', metavar=None, type=str,
nargs="+", required=True,
help='Music collection path')
parser.add_argument('-t', dest='tmp_dir', metavar=None, type=str,
nargs=None, default=os.path.expanduser('~/.iposonic'),
help='Temporary directory, defaults to ~/.iposonic')
parser.add_argument('--profile', metavar=None, type=bool,
nargs='?', const=True, default=False,
help='profile with yappi')
parser.add_argument(
'--access-file', dest='access_file', action=None, type=str,
default=os.path.expanduser('~/.iposonic_auth'),
help='Access file for user authentication, defaults to ~/.iposonic_auth. Use --noauth to disable authentication.')
parser.add_argument(
'--noauth', dest='noauth', action=None, type=bool,
nargs='?', const=True, default=False,
help='Disable authentication.')
parser.add_argument(
'--free-coverart', dest='free_coverart', action=None, type=bool,
const=True, default=False, nargs='?',
help='Do not authenticate requests to getCoverArt. Default is False: iposonic requires authentication for every request.')
parser.add_argument('--resetdb', dest='resetdb', action=None, type=bool,
const=True, default=False, nargs='?',
help='Drop database and cache directories and recreate them.')
parser.add_argument(
'--rename-non-utf8', dest='rename_non_utf8', action=None, type=bool,
const=True, default=False, nargs='?',
help='Rename non utf8 files to utf8 guessing encoding. When false, iposonic support only utf8 filenames.')
args = parser.parse_args()
print(args)
if args.profile:
yappize()
app.config.update(args.__dict__)
for x in args.collection:
assert(os.path.isdir(x)), "Missing music folder: %s" % x
app.iposonic = Iposonic(args.collection, dbhandler=Dbh,
recreate_db=args.resetdb, tmp_dir=args.tmp_dir)
app.iposonic.db.init_db()
# While developing don't enforce authentication
# otherwise you can use a credential file
# or specify your users inline
skip_authentication = args.noauth
app.authorizer = Authorizer(
mock=skip_authentication, access_file=args.access_file)
#
# Run cover_art downloading thread
#
from mediamanager.cover_art import cover_art_worker, cover_art_mock
for i in range(1):
t = Thread(target=cover_art_worker, args=[app.iposonic.cache_dir])
t.daemon = True
t.start()
#
# Run scrobbling thread
#
from mediamanager.scrobble import scrobble_worker
for i in range(1):
t = Thread(target=scrobble_worker, args=[])
t.daemon = True
t.start()
#
# Run walker thread
#
from scanner import walk_music_folder
for i in range(1):
t = Thread(target=walk_music_folder, args=[app.iposonic])
t.daemon = True
t.start()
app.run(host='0.0.0.0', port=5000, debug=False)
开发者ID:SimonHova,项目名称:iposonic,代码行数:86,代码来源:main.py
示例6: main
def main():
# app.run(debug=True, port=5000, host="0.0.0.0")
app.run(debug=True, port=5000)
开发者ID:BigDipper7,项目名称:RobotDataManagementSystem,代码行数:3,代码来源:start-server.py
示例7: execfile
#!/usr/bin/env python
import os
if 'OPENSHIFT_PYTHON_DIR' in os.environ:
virtenv = os.environ['OPENSHIFT_PYTHON_DIR'] + '/virtenv/'
virtualenv = os.path.join(virtenv, 'bin/activate_this.py')
try:
execfile(virtualenv, dict(__file__=virtualenv))
except IOError:
pass
from webapp import app
if __name__ == '__main__':
app.run(server='gevent',
host=os.environ.get('OPENSHIFT_PYTHON_IP', '127.0.0.1'),
port=os.environ.get('OPENSHIFT_PYTHON_PORT', 8080))
开发者ID:larsks,项目名称:remarkable,代码行数:18,代码来源:app.py
示例8: int
#!/usr/bin/env python
from webapp import app
import os
port = int(os.environ.get("PORT", 5000))
app.run(host="0.0.0.0", port=port, debug=False)
开发者ID:kaben,项目名称:webapp-boilerplates,代码行数:6,代码来源:run.py
示例9: start_test_server
print APPROOT
sys.path.append(APPROOT)
from flask import request
os.environ['OPENEM_CONFIG'] = 'config.selenium'
from webapp import app, db
HOST = 'localhost'
PORT = 5001
SERVER_URL = 'http://%s:%s/' % (HOST, PORT)
from logging import StreamHandler
app.logger.addHandler(StreamHandler())
server = threading.Thread(target=lambda: app.run(host=HOST, port=PORT, debug=False))
def start_test_server():
with app.app_context():
db.drop_all()
db.create_all()
server.start()
def shutdown_test_server():
urllib.urlopen(SERVER_URL + 'shutdown')
server.join()
@app.route('/shutdown')
def shutdown_server_handler():
func = request.environ.get('werkzeug.server.shutdown')
if func is None:
开发者ID:openemotion,项目名称:webapp,代码行数:31,代码来源:app.py
示例10:
#!/usr/bin/env python
#
# WSGI Main script
from webapp import app
if __name__ == '__main__':
# cmdline version
app.run(host='0.0.0.0', port=5000, debug=True)
开发者ID:jorgbosman,项目名称:website,代码行数:9,代码来源:app.py
示例11:
#!venv/bin/python
from webapp.config import FLASK_PORT_PROD, FLASK_PORT_DEV, PRODUCTION
from webapp import app
if __name__ == '__main__':
if PRODUCTION:
app.run(debug=False, threaded=True, port=FLASK_PORT_PROD)
else:
app.run(debug=True, port=FLASK_PORT_DEV)
开发者ID:aimeemorgan,项目名称:menu_project,代码行数:11,代码来源:run.py
示例12:
__author__ = 'ramessne'
from webapp import app
app.run(host="10.74.44.36",debug=True,port=8080)
开发者ID:rmessner,项目名称:ansible-web,代码行数:4,代码来源:run.py
示例13: int
from webapp import app
import os
port = os.environ.get('PORT', 5002)
try:
port = int(port)
app.run(debug=True, host='localhost', port=port)
except ValueError as e:
print('Webapp not started: {}'.format(e))
开发者ID:dssg,项目名称:hitchhikers-guide,代码行数:9,代码来源:run.py
示例14:
#!/usr/bin/env python
#coding: utf-8
from webapp import app
if __name__ == "__main__":
app.debug = True
app.run("192.168.10.106", 8080)
开发者ID:rakou1986,项目名称:flask-mvt-min,代码行数:8,代码来源:main.py
示例15:
# encoding: utf-8
import os
from webapp import app
app.run(debug=True, host='0.0.0.0')
开发者ID:exmatrikulator,项目名称:behoerden-online-dienste.de,代码行数:6,代码来源:runserver.py
示例16:
#!/usr/bin/python
from webapp import app
app.run(host='0.0.0.0', debug=True)
开发者ID:revmic,项目名称:westwindow,代码行数:3,代码来源:run_debug.py
示例17:
#!/usr/bin/env python
from webapp import app
if __name__ == "__main__":
app.run(host='0.0.0.0', port=5000)
开发者ID:xinluh,项目名称:takeNote,代码行数:5,代码来源:runwebapp_ec2.py
示例18:
#!../.virtualenvs/doppler_env/bin/python
from webapp import app
app.run(host = '0.0.0.0', port = 8080, debug = True)
开发者ID:diegopradogesto,项目名称:DopplerSW,代码行数:3,代码来源:run.py
示例19: index
@app.route('/')
def index():
return render_template('index.html')
@app.route('/add', methods=['POST'])
def add():
form = request.form['input']
add = api.add(form)
return str({'string':'string'})
@app.route('/get', methods=['POST'])
def get():
retr = api.get()
return str(retr)
@app.route('/edit', methods=['POST'])
def edit():
form = request.form['input']
rval = request.form['replace']
edit = api.edit(form,rval)
return str({'string':'string'})
@app.route('/delete', methods=['POST'])
def delete():
form = request.form['input']
dele = api.delete(form)
return str({'string':'string'})
if __name__ == "__main__":
app.run()
开发者ID:ivandevera,项目名称:webapp,代码行数:30,代码来源:wsgi.py
示例20:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Run a test server.
from webapp import app
app.run(host="0.0.0.0", port=8080, debug=True)
开发者ID:poserg,项目名称:photo-groupinator,代码行数:7,代码来源:run.py
注:本文中的webapp.app.run函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论