Tornado 6.1 Documentation
repository as well. Prerequisites: Tornado 6.0 requires Python 3.5.2 or newer (See Tornado 5.1 if compatibility with Python 2.7 is required). The following optional packages may be useful: • pycurl is used http_client = AsyncHTTPClient() response = await http_client.fetch(url) return response.body Or for compatibility with older versions of Python, using the tornado.gen module: from tornado.httpclient import AsyncHTTPClient and await keywords (functions using these keywords are also called “native coroutines”). For compatibility with older versions of Python, you can use “decorated” or “yield-based” coroutines using the tornado0 码力 | 245 页 | 904.24 KB | 1 年前3
Tornado 6.0 Documentation
repository as well. Prerequisites: Tornado 6.0 requires Python 3.5.2 or newer (See Tornado 5.1 if compatibility with Python 2.7 is required). The following optional packages may be useful: • pycurl is used http_client = AsyncHTTPClient() response = await http_client.fetch(url) return response.body Or for compatibility with older versions of Python, using the tornado.gen module: 14 Chapter 6. Documentation Tornado and await keywords (functions using these keywords are also called “native coroutines”). For compatibility with older versions of Python, you can use “decorated” or “yield-based” coroutines using the tornado0 码力 | 245 页 | 885.76 KB | 1 年前3
Tornado 5.1 Documentation
http_client = AsyncHTTPClient() response = await http_client.fetch(url) return response.body Or for compatibility with older versions of Python, using the tornado.gen module: from tornado.httpclient import AsyncHTTPClient and await keywords (functions using these keywords are also called “native coroutines”). For compatibility with older versions of Python, you can use “decorated” or “yield-based” coroutines using the tornado Native coroutines are the recommended form whenever possible. Only use decorated coroutines when compatibility with older versions of Python is required. Examples in the tornado documentation will generally0 码力 | 243 页 | 895.80 KB | 1 年前3
Tornado 4.5 Documentation
decorator, and await in place of yield. The rest of this document still uses the yield style for compatibility with older versions of Python, but async and await will run faster when they are available: async le/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 authorization def initialize(self, database): self.database = database def get(self, username): ... app = Application([ (r'/user/(.*)', ProfileHandler, dict(database=database)), ]) RequestHandler0 码力 | 333 页 | 322.34 KB | 1 年前3
Tornado 6.5 Documentationhttp_client = AsyncHTTPClient() response = await http_client.fetch(url) return response.body Or for compatibility with older versions of Python, using the tornado.gen module: 14 Chapter 6. DocumentationTornado and await keywords (functions using these keywords are also called “native corou- tines”). For compatibility with older versions of Python, you can use “decorated” or “yield-based” coroutines using the tornado Native coroutines are the recommended form whenever possible. Only use decorated coroutines when compatibility with older versions of Python is required. Examples in the Tornado documentation will generally0 码力 | 272 页 | 1.12 MB | 3 月前3
Tornado 6.2 Documentation
http_client = AsyncHTTPClient() response = await http_client.fetch(url) return response.body Or for compatibility with older versions of Python, using the tornado.gen module: 14 Chapter 6. Documentation Tornado and await keywords (functions using these keywords are also called “native corou- tines”). For compatibility with older versions of Python, you can use “decorated” or “yield-based” coroutines using the tornado Native coroutines are the recommended form whenever possible. Only use decorated coroutines when compatibility with older versions of Python is required. Examples in the Tornado documentation will generally0 码力 | 260 页 | 1.06 MB | 1 年前3
Tornado 6.4 Documentation
http_client = AsyncHTTPClient() response = await http_client.fetch(url) return response.body Or for compatibility with older versions of Python, using the tornado.gen module: 14 Chapter 6. Documentation Tornado and await keywords (functions using these keywords are also called “native corou- tines”). For compatibility with older versions of Python, you can use “decorated” or “yield-based” coroutines using the tornado Native coroutines are the recommended form whenever possible. Only use decorated coroutines when compatibility with older versions of Python is required. Examples in the Tornado documentation will generally0 码力 | 268 页 | 1.09 MB | 1 年前3
Tornado 6.4 Documentation
http_client = AsyncHTTPClient() response = await http_client.fetch(url) return response.body Or for compatibility with older versions of Python, using the tornado.gen module: 14 Chapter 6. Documentation Tornado and await keywords (functions using these keywords are also called “native corou- tines”). For compatibility with older versions of Python, you can use “decorated” or “yield-based” coroutines using the tornado Native coroutines are the recommended form whenever possible. Only use decorated coroutines when compatibility with older versions of Python is required. Examples in the Tornado documentation will generally0 码力 | 268 页 | 1.09 MB | 1 年前3
Tornado 6.4 Documentation
http_client = AsyncHTTPClient() response = await http_client.fetch(url) return response.body Or for compatibility with older versions of Python, using the tornado.gen module: 14 Chapter 6. Documentation Tornado and await keywords (functions using these keywords are also called “native corou- tines”). For compatibility with older versions of Python, you can use “decorated” or “yield-based” coroutines using the tornado Native coroutines are the recommended form whenever possible. Only use decorated coroutines when compatibility with older versions of Python is required. Examples in the Tornado documentation will generally0 码力 | 268 页 | 1.09 MB | 1 年前3
Tornado 4.5 Documentation
decorator, and await in place of yield. The rest of this document still uses the yield style for compatibility with older versions of Python, but async and await will run faster when they are available: async 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 authorization ler): def initialize(self, database): self.database = database def get(self, username): ... app = Application([ (r'/user/(.*)', ProfileHandler, dict(database=database)), ]) RequestHandler.prepare()0 码力 | 222 页 | 833.04 KB | 1 年前3
共 20 条
- 1
- 2













