Python app.app 模块,debug() 实例源码

我们从Python开源项目中,提取了以下9个代码示例,用于说明如何使用app.app.debug()

项目:git-webhook    作者:NetEaseGame    | 项目源码 | 文件源码
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)
项目:SWEETer-Cat    作者:DanielAndreasen    | 项目源码 | 文件源码
def app():
    sc_app.testing = True
    sc_app.debug = True
    return sc_app
项目:arch-security-tracker    作者:archlinux    | 项目源码 | 文件源码
def internal_error(e):
    if app.debug:
        raise e
    code = hexlify(urandom(4)).decode()
    error(Exception("Code: {}".format(code), e), exc_info=True)
    text = '500: Deep Shit\n{}'.format(code)
    return handle_error(text, InternalServerError.code)
项目:web_develop    作者:dongweiming    | 项目源码 | 文件源码
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!'))
项目:eventit    作者:alfredgg    | 项目源码 | 文件源码
def runserver():
    from eventit.eventit import app
    app.run(
        host="0.0.0.0",
        port=8080,
        debug=True
    )

# TODO: Create admin user
项目:git-webhook    作者:NetEaseGame    | 项目源码 | 文件源码
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
项目:uberemind    作者:mayurbhangale    | 项目源码 | 文件源码
def setUp(self):
        # Necessary to disable SSLify
        app.debug = True
        self.test_app = app.test_client()
        self.session = app.requests_session
项目:fanfou-10th-anniversary    作者:simpleapples    | 项目源码 | 文件源码
def run():
        global application
        app.debug = True
        application = DebuggedApplication(application, evalex=True)
        server = WSGIServer(('localhost', PORT), application, handler_class=WebSocketHandler)
        server.serve_forever()
项目:LTHCourseStatistics    作者:TabTabTab    | 项目源码 | 文件源码
def main(argv):
    from app import app
    app.debug = "debug" in argv or IS_DEBUG
    app.run(port=5006)