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

Python app.run函数代码示例

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

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



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

示例1: f

 def f(MessageBox):
     from web import app
     app.MessageBox = MessageBox
     try:
         app.run(debug=True, use_reloader=False)
     except AttributeError:
         pass
开发者ID:korylprince,项目名称:BeagleCommand,代码行数:7,代码来源:__init__.py


示例2: start_standalone_server

def start_standalone_server(host=None, port=None, debug=True):
    if not config.check():
        sys.exit(1)

    if not os.path.exists(config.get('base', 'cache_dir')):
        os.makedirs(config.get('base', 'cache_dir'))

    import db
    from web import app

    db.init_db()
    app.run(host=host, port=port, debug=debug)
开发者ID:jvechinski,项目名称:supysonic,代码行数:12,代码来源:server.py


示例3:

from web import app

app.run(port=80, host="0.0.0.0")
开发者ID:allanfann,项目名称:search-hackpad-g0v,代码行数:3,代码来源:web.py


示例4: Copyright

#!/usr/bin/env python
#
# Copyright (c) 2013 Piston Cloud Computing, Inc.
# All Rights Reserved.
#
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
#    not use this file except in compliance with the License. You may obtain
#    a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    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.
import os

from web import app


app.logger.setLevel('DEBUG')
port = int(os.environ.get('PORT', 5000))
app.run(host='172.16.200.128', port=port, debug=True)
开发者ID:dlenwell,项目名称:refstack,代码行数:24,代码来源:runserver.py


示例5:

#!/usr/bin/env python
from web import app
app.run(debug=True)
开发者ID:mansam,项目名称:meatbase,代码行数:3,代码来源:runserver.py


示例6: dirname

import sys
import os
from os.path import dirname, join
sys.path.insert(0, dirname(__file__))
activate_this = join(dirname(__file__), '.env', 'bin', 'activate_this.py')
execfile(activate_this, dict(__file__=activate_this))

from web import app as application
from web.apps.frontend import frontend
application.register_blueprint(frontend)
application.debug = True

if __name__ == '__main__':
    application.run('0.0.0.0')

开发者ID:chrmorais,项目名称:p4a-cloud,代码行数:14,代码来源:wsgi.py


示例7:

#!venv/bin/python
from web import app

if __name__ == "__main__":
    app.run(host="0.0.0.0")
开发者ID:hmajoros,项目名称:web,代码行数:5,代码来源:run.py


示例8: int

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


import os

from web import app


if __name__ == '__main__':
    port = int(os.environ.get('PORT', 5000))
    app.run(host='0.0.0.0', port=port, debug=True)
开发者ID:encukou,项目名称:python.cz,代码行数:12,代码来源:runserver.py


示例9: islocal

import os

from web import app


def islocal():
    return os.environ["SERVER_NAME"] in ("localhost")

# FIXME this needs to be moved to a private file
app.secret_key = "b'\xdb\xe2\x14c\xee!\xb7F\x9c\xc8x\x8b\x04b\xbf\xad(\xc5(\x9f\x9az\xd6\x92'"

if __name__ == '__main__':
    extra_dirs = ['.']
    extra_files = extra_dirs[:]
    for extra_dir in extra_dirs:
        for dirname, dirs, files in os.walk(extra_dir):
            for filename in files:
                filename = os.path.join(dirname, filename)
                if os.path.isfile(filename):
                    extra_files.append(filename)

    host = os.getenv('IP', '0.0.0.0')
    port = int(os.getenv('PORT', '5000'))
    app.run(host=host, port=port, debug=True, extra_files=extra_files)
开发者ID:wallone,项目名称:pepto-web-master,代码行数:24,代码来源:run.py


示例10:

# -*- coding: utf-8 -*-
"""
   Входной скрипт

    :copyright: (c) 2013 by Pavel Lyashkov.
    :license: BSD, see LICENSE for more details.
"""
from web import app
app.config.from_object('configs.general.DevelopmentConfig')
app.run(host='127.0.0.1', port=4001)
开发者ID:bigbag,项目名称:archive_term-flask,代码行数:10,代码来源:run_debug.py


示例11: main

def main():
    app.run(host=LISTEN_HOST, port=LISTEN_PORT)
开发者ID:rmariano,项目名称:Clean-code-in-Python,代码行数:2,代码来源:service.py


示例12: int

"""
import os
from os import *
import pathlib
from os import environ
from web import app

if __name__ == '__main__':

    # Setup the host url and port
    HOST = environ.get('SERVER_HOST', 'localhost')
    try:
        PORT = int(environ.get('SERVER_PORT', '5555'))
    except ValueError:
        PORT = 5555
 
    # Setup extra_files to watch - http://stackoverflow.com/questions/9508667/reload-flask-app-when-template-file-changes
    extra_dirs = ['donkus', 'web']
    extra_files = extra_dirs[:]
    for extra_dir in extra_dirs:
        for dirname, dirs, files in os.walk(extra_dir):
            for filename in files:
                filename = path.join(dirname, filename)
                if path.isfile(filename):
                    extra_files.append(filename)

    # Start with watching the extra files and reloading enabled
    app.run(HOST, PORT, extra_files=extra_files, debug=True)

    # Start without for Visual Studio debugger to work on static py files at build time
    #app.run(HOST, PORT)
开发者ID:jclosure,项目名称:donkus,代码行数:31,代码来源:runserver.py


示例13: get_easy_settings

from web import app
from config.settings import get_easy_settings

#app.config.from_object(get_easy_settings())

server_settings = get_easy_settings()

app.run(host='0.0.0.0', debug=server_settings.DEBUG, port=server_settings.PORT)
开发者ID:thingdeux,项目名称:PyFileCleaner,代码行数:8,代码来源:runserver.py


示例14: str

    monaco = schema.Monaco()
    monaco.refresh(r)
    node_id = str(node_id)
    if not node_id in monaco.node_ids:
        abort(404)
    node = schema.MonacoNode(node_id=node_id)
    node.refresh(r)
    appinfo = node.app_info(r)
    data = {
        'node_id': node_id,
        'hostname': node.hostname,
        'FQDN': node.FQDN,
        'total_memory': node.total_memory,
        'rack': node.rack,
        'status': node.status,
        'used_memory': appinfo['memory'],
        'memory_percent': round(100.0 * appinfo['memory'] / (int(node.total_memory) / 2.0), 2),
        'master_servers': len(appinfo['masters']),
        'masters': map(str,sorted(map(int,appinfo['masters']))),
        'slave_servers': len(appinfo['slaves']),
        'slaves': map(str,sorted(map(int,appinfo['slaves']))),
        'twemproxy_servers': len(node.twems),
        # General info
        'nodes': map(str,sorted(map(int,monaco.node_ids))),
    }
 
    return render_template("node.html", **data)

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


示例15:

#!/usr/bin/env python

import argparse
from web import app

if __name__ == "__main__":
    parser = argparse.ArgumentParser(description="Runs Topmodel Server")
    parser.add_argument(
        "--remote", "-r", action="store_true", default=False, help="Use data from S3")
    parser.add_argument("--development", "-d", action="store_true",
                        default=False, help="Run topmodel in development mode with autoreload")
    args = parser.parse_args()
    app.local = not args.remote
    app.run(port=9191, host="0.0.0.0",
            debug=True, use_reloader=args.development)
开发者ID:MiguelPeralvoPM,项目名称:topmodel,代码行数:15,代码来源:topmodel_server.py


示例16: int

import os
from web import app

if __name__ == '__main__':
    port = int(os.environ.get('PORT', 5000))
    app.run(host='0.0.0.0',
            port=port,
            debug=os.environ.get('DEBUG', False))
开发者ID:ErinCall,项目名称:splinter_demo,代码行数:8,代码来源:app.py


示例17:

# -*- coding:utf-8 -*-
__author__ = 'root'

from web import app

if __name__ == '__main__':
    app.run(host='0.0.0.0',port=app.config["PORT"], debug=app.config["DEBUG"])
开发者ID:liue,项目名称:pydelo,代码行数:7,代码来源:manage.py


示例18: Thread

from market import emdr
from web import app
from market.priceservice import PriceService

# Kick off the price service.
PriceService.start()
from threading import Thread

#thread = Thread(target=emdr)

# Dummy call for strptime due to a bug in python regarding threading.
# The error: failed to import _strptime because the import lock is held by another thread
import datetime
datetime.datetime.strptime('2013-01-01', '%Y-%m-%d')
#thread.start()

app.run(host='0.0.0.0', debug = True, use_reloader=False)
开发者ID:imclab,项目名称:EveMarketAnalysis,代码行数:17,代码来源:run.py


示例19: initMessage

#from gevent.pywsgi import WSGIServer
# from web import log
import log

def initMessage():
	log.info("========= RUNNING debug.py ================")

initMessage()

from web import app
app.run('0.0.0.0',3031, debug=True)
# WSGIServer(('0.0.0.0',5000),app,log=None).serve_forever()
# app.run()

开发者ID:chinnurtb,项目名称:foos,代码行数:13,代码来源:debug.py


示例20:

#!/usr/bin/python
# coding=utf-8
''' Running the stand-alone wsgi module '''
from __future__ import absolute_import, print_function, division

from web import app
application = app.wsgi_app

if __name__ == '__main__':
    app.run(host='0.0.0.0', port=80)
开发者ID:asimkhaja,项目名称:monaco,代码行数:10,代码来源:webserver.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python template.render_jinja函数代码示例发布时间:2022-05-26
下一篇:
Python web.websafe函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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