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


Python app.debug方法代码示例

本文整理汇总了Python中app.app.debug方法的典型用法代码示例。如果您正苦于以下问题:Python app.debug方法的具体用法?Python app.debug怎么用?Python app.debug使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app.app的用法示例。


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

示例1: __call__

# 需要导入模块: from app import app [as 别名]
# 或者: from app.app import debug [as 别名]
def __call__(self, app, host, port, use_debugger, use_reloader):
        # override the default runserver command to start a Socket.IO server
        if use_debugger is None:
            use_debugger = app.debug
            if use_debugger is None:
                use_debugger = True
        if use_reloader is None:
            use_reloader = app.debug
        import eventlet
        # monkey_patch
        eventlet.monkey_patch()

        socketio.run(app,
                     host=host,
                     port=port,
                     debug=use_debugger,
                     use_reloader=use_reloader,
                     **self.server_options) 
开发者ID:NetEaseGame,项目名称:git-webhook,代码行数:20,代码来源:manage.py

示例2: run

# 需要导入模块: from app import app [as 别名]
# 或者: from app.app import debug [as 别名]
def run():
        global application
        app.debug = True
        application = DebuggedApplication(application, evalex=True)
        server = WSGIServer(('localhost', PORT), application, handler_class=WebSocketHandler)
        server.serve_forever() 
开发者ID:leancloud,项目名称:python-getting-started,代码行数:8,代码来源:wsgi.py

示例3: get_options

# 需要导入模块: from app import app [as 别名]
# 或者: from app.app import debug [as 别名]
def get_options(self):
        options = (
            Option('-h', '--host',
                   dest='host',
                   default='0.0.0.0'),
            Option('-p', '--port',
                   dest='port',
                   type=int,
                   default=18340),
            Option('-d', '--debug',
                   action='store_true',
                   dest='use_debugger',
                   help=('enable the Werkzeug debugger (DO NOT use in '
                         'production code)'),
                   default=self.use_debugger),
            Option('-D', '--no-debug',
                   action='store_false',
                   dest='use_debugger',
                   help='disable the Werkzeug debugger',
                   default=self.use_debugger),
            Option('-r', '--reload',
                   action='store_true',
                   dest='use_reloader',
                   help=('monitor Python files for changes (not 100%% safe '
                         'for production use)'),
                   default=self.use_reloader),
            Option('-R', '--no-reload',
                   action='store_false',
                   dest='use_reloader',
                   help='do not monitor Python files for changes',
                   default=self.use_reloader),
        )
        return options 
开发者ID:NetEaseGame,项目名称:git-webhook,代码行数:35,代码来源:manage.py

示例4: get_banner

# 需要导入模块: from app import app [as 别名]
# 或者: from app.app import debug [as 别名]
def get_banner():
    from app import app
    color_tmpl = '\x1b[{}m{}\x1b[0m'
    return color_tmpl.format(
        *(32, 'Development shell, do whatever you want.')
        if app.debug else (
            35, 'Production shell, use it carefully!')) 
开发者ID:dongweiming,项目名称:web_develop,代码行数:9,代码来源:shell.py


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