本文整理匯總了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)
示例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()
示例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
示例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!'))