Tornado 5.1 Documentation
Blog example application for a complete example that uses authentication (and stores user data in a MySQL database). Third party authentication The tornado.auth module implements the authentication and 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=80800 码力 | 243 页 | 895.80 KB | 1 年前3Tornado 6.0 Documentation
Blog example application for a complete example that uses authentication (and stores user data in a MySQL database). Third party authentication The tornado.auth module implements the authentication and 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=80800 码力 | 245 页 | 885.76 KB | 1 年前3Tornado 5.1 Documentation
ee/stable/demos/blog] for a complete example that uses authentication (and stores user data in a MySQL database). Third party authentication The tornado.auth module implements the authentication and 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=80800 码力 | 359 页 | 347.32 KB | 1 年前3Tornado 6.0 Documentation
ee/stable/demos/blog] for a complete example that uses authentication (and stores user data in a MySQL database). Third party authentication The tornado.auth module implements the authentication and 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=80800 码力 | 869 页 | 692.83 KB | 1 年前3Tornado 4.5 Documentation
ee/stable/demos/blog] for a complete example that uses authentication (and stores user data in a MySQL database). Third party authentication The tornado.auth module implements the authentication and added to the global option namespace, e.g.: 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) ... The main() method of your application does not need to be aware of all of the options0 码力 | 333 页 | 322.34 KB | 1 年前3Tornado 6.1 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 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 码力 | 245 页 | 904.24 KB | 1 年前3Tornado 4.5 Documentation
Blog example application for a complete example that uses authentication (and stores user data in a MySQL database). Third party authentication The tornado.auth module implements the authentication and added to the global option namespace, e.g.: 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) ... The main() method of your application does not need to be aware of all of the options used0 码力 | 222 页 | 833.04 KB | 1 年前3Tornado 6.4 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 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 码力 | 268 页 | 1.09 MB | 1 年前3Tornado 6.2 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) ... (continues on next page) 148 Chapter 6. Documentation Tornado Documentation, Release 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 码力 | 260 页 | 1.06 MB | 1 年前3Tornado 6.4 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 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 码力 | 268 页 | 1.09 MB | 1 年前3
共 20 条
- 1
- 2