Tornado 6.5 Documentation
attributes of tornado.options.options: # myapp/db.py from tornado.options import define, options define("mysql_host", default="127.0.0.1:3306", help="Main user DB") define("memcache_hosts", default="127.0.0.1:11011" multiple=True, help="Main user memcache servers") def connect(): db = database.Connection(options.mysql_host) ... # myapp/server.py from tornado.options import define, options define("port", default=8080 docs of this module): 154 Chapter 6. DocumentationTornado Documentation, Release 6.5.1 port = 80 mysql_host = 'mydb.example.com:3306' # Both lists and comma-separated strings are allowed for # multiple=True0 码力 | 272 页 | 1.12 MB | 2 月前3Tornado 6.5 Documentation
of tornado.options.options: # myapp/db.py from tornado.options import define, options define("mysql_host", default="127.0.0.1:3306", help="Main user DB") define("memcache_hosts", default="127.0.0.1:11011" help="Main user memcache servers") def connect(): db = database.Connection(options.mysql_host) ... # myapp/server.py from tornado.options import define, options define("port", default=8080 parse_command_line) Example (using the options defined in the top-level docs of this module): port = 80 mysql_host = 'mydb.example.com:3306' # Both lists and comma-separated strings are allowed for # multiple=True0 码力 | 437 页 | 405.14 KB | 2 月前3
共 2 条
- 1
相关搜索词