{ "version": "https://jsonfeed.org/version/1", "title": "Tornado", "description": "Tornado is an open source version of the scalable, non-blocking web server and tools that power FriendFeed.", "home_page_url": "go/tornado", "feed_url": "feed/tornado.json", "icon": "https://cdn.v2ex.com/navatar/5272/0e00/361_large.png?m=1579007184", "favicon": "https://cdn.v2ex.com/navatar/5272/0e00/361_normal.png?m=1579007184", "items": [ { "author": { "url": "member/akura", "name": "akura", "avatar": "https://cdn.v2ex.com/gravatar/27ac91d138177bc90a628c35a8b44cc9?s=73&d=retro" }, "url": "t/619557", "title": "docker \u591a\u8fdb\u7a0b\u90e8\u7f72 tornado", "id": "t/619557", "date_published": "2019-11-14T07:30:26+00:00", "content_html": "
    \n
  1. \u901a\u5e38\u7684\u90e8\u7f72\u65b9\u5f0f\u662f nginx \u8d1f\u8f7d\u5747\u8861\u5230\u591a\u4e2a\u7aef\u53e3\uff0c\u6bcf\u4e2a\u7aef\u53e3\u7ed1\u5b9a\u5f00\u542f\u4e00\u4e2a tornado \u670d\u52a1\uff0c\u901a\u8fc7 supervisor \u53ef\u4ee5\u5f88\u65b9\u4fbf\u76d1\u63a7\u670d\u52a1\u3002
  2. \n
  3. \u73b0\u5728\u60f3 tornado \u591a\u8fdb\u7a0b\u7528 docker \u90e8\u7f72\uff0c\u5177\u4f53\u7684\u67b6\u6784\u65b9\u6848\u662f\u600e\u4e48\u6837\u7684\uff1f\u662f\u4e00\u4e2a docker \u5bb9\u5668\u4e00\u4e2a\u8fdb\u7a0b\u8fd8\u662f\u4e00\u4e2a docker \u591a\u4e2a\u8fdb\u7a0b\uff1f
  4. \n
\n" }, { "author": { "url": "member/zhze93", "name": "zhze93", "avatar": "https://cdn.v2ex.com/gravatar/15e81bb25e3872f48d6657d5de1d4905?s=73&d=retro" }, "url": "t/558602", "title": "Tornado \u5982\u4f55\u62ff\u5230\u4f20\u8f93\u7684\u6587\u4ef6\u6d41", "id": "t/558602", "date_published": "2019-04-25T06:58:13+00:00", "content_html": "

\u4e00\u4e2a\u5927\u6587\u4ef6
\n\u6211\u5728 client \u901a\u8fc7 requests \u5e93\u6765\u8fdb\u884c\u4f20\u8f93

\n
with open(path_file, \"rb\") as f:\n res = requests.post(url, data=f, timeout=600)\n
\n

\u6211\u5728 server \u7aef\uff0c\u4ece tornado_request \u4e2d\u8be5\u5982\u4f55\u63a5\u6536\u8fd9\u4e2a\u6587\u4ef6\u6d41\u5e76\u4fdd\u5b58\u4e0b\u6765\u5462\u3002
\n\u8c22\u8c22\u5404\u4f4d\u7684\u4e0d\u541d\u8d50\u6559\u3002

\n" }, { "author": { "url": "member/aoscici2000", "name": "aoscici2000", "avatar": "https://cdn.v2ex.com/gravatar/45fecfe863567980c5951ddd8b633a8c?s=73&d=retro" }, "url": "t/527071", "title": "Tornado \u7684\u5f02\u6b65 \u600e\u4e48\u5199\u7684", "id": "t/527071", "date_published": "2019-01-14T17:43:42+00:00", "content_html": "

\u770b\u5f97\u6559\u7a0b\u4e00\u5934\u96fe\u6c34, \u53ea\u80fd\u7406\u89e3\u90a3\u4e2a\u81ea\u5e26\u7684 http \u8bf7\u6c42, \u770b\u4e86\u5f88\u4e45\u4e5f\u6ca1\u770b\u5230\u6709\u6bd4\u5982\u6570\u636e\u5e93\u67e5\u8be2, \u6587\u4ef6\u5904\u7406\u4ec0\u4e48\u7684\u5176\u4ed6\u4f8b\u5b50, \u540e\u6765\u53bb\u770b\u770b\u5176\u4ed6\u6559\u7a0b, \u5b9e\u73b0\u5012\u7b97\u662f\u52c9\u5f3a\u5b9e\u73b0\u4e86, \u4f46\u611f\u89c9\u4e5f\u592a\u590d\u6742\u4e86\u5427? ?

\n

\u5c31\u6bd4\u5982\u4f8b\u5b50\u4e2d\u7684\u6211\u5047\u8bbe\u6709\u4e2a\u957f\u8017\u65f6\u7684\u4efb\u52a1, \u600e\u4e48\u5199\u624d\u4f1a\u7b80\u5355\u70b9?

\n
\nimport tornado.ioloop\nimport tornado.web\nimport time\nimport _thread\n\n\n# \u6a21\u62df\u8017\u65f6\u4efb\u52a1\ndef long_work(arg):\n time.sleep(5)\n yield arg * 1024\n\n\ndef mycoroutine(func):\n def wrapper(self):\n gen = func(self)\n work_gen = next(gen)\n def fun():\n result = next(work_gen)\n try:\n \tgen.send(result)\n except StopIteration:\n \tpass\n _thread.start_new_thread(fun, ())\n return wrapper\n\n\nclass IndexHandler(tornado.web.RequestHandler):\n @tornado.web.asynchronous\n @mycoroutine\n def get(self):\n arg = 10 # \u5047\u8bbe\u8bf7\u6c42\u7684\u53c2\u6570\n result = yield long_work(arg)\n self.finish(f'<h1>Index {result}</h1>')\n\n\nclass SyncHandler(tornado.web.RequestHandler):\n def get(self):\n \tself.write('<h1>SyncHandler</h1>')\n\n\ndef make_app():\n return tornado.web.Application([\n (r'/', IndexHandler),\n (r'/sync', SyncHandler)\n ])\n\n\nif __name__ == '__main__':\n app = make_app()\n app.listen(8888)\n tornado.ioloop.IOLoop.current().start()\n \n
\n" }, { "author": { "url": "member/aoscici2000", "name": "aoscici2000", "avatar": "https://cdn.v2ex.com/gravatar/45fecfe863567980c5951ddd8b633a8c?s=73&d=retro" }, "url": "t/514006", "title": "tornado \u4e0b ckeditor \u56fe\u7247\u4e0a\u4f20\u95ee\u9898", "id": "t/514006", "date_published": "2018-12-03T14:58:02+00:00", "content_html": "

\u6309\u7f51\u4e0a\u7684\u65b9\u6cd5\u66f4\u6539\u4e86\u914d\u7f6e\u540e,\u5355\u7eaf\u672c\u5730\u6253\u5f00 html \u6587\u4ef6\u662f\u663e\u793a\u6709\u56fe\u7247\u4e0a\u4f20\u7684\u9009\u9879\u7684, \u4f46\u670d\u52a1\u8dd1\u8d77\u6765\u7684\u65b9\u5f0f\u6253\u5f00\u7684\u8bdd, \u5c31\u6ca1\u6709\u4e86, \u8fd9\u662f\u600e\u4e48\u56de\u4e8b??

\n" }, { "author": { "url": "member/aoscici2000", "name": "aoscici2000", "avatar": "https://cdn.v2ex.com/gravatar/45fecfe863567980c5951ddd8b633a8c?s=73&d=retro" }, "url": "t/513504", "title": "Tornado \u5f02\u6b65\u600e\u4e48\u5199\u7684?", "id": "t/513504", "date_published": "2018-12-02T04:22:59+00:00", "content_html": "

\u6bd4\u5982\u8bf4\u8981\u7b49\u67d0\u4e2a\u8017\u65f6\u64cd\u4f5c\u7684\u7ed3\u679c, \u8be5\u600e\u4e48\u5199?

\n

\u7f51\u4e0a\u770b\u4e86\u534a\u5929\u4f8b\u5b50, \u7167\u7740\u505a\u4e86\u505a, \u8c8c\u4f3c\u884c\u4e0d\u901a

\n

class AsyncTaskHandler(tornado.web.RequestHandler):

\n
@tornado.web.asynchronous\n@tornado.gen.coroutine\ndef get(self, *args, **kwargs):\n resp = yield tornado.gen.Task(self.do_something)\n self.finish(resp)\n\n@tornado.gen.coroutine\ndef do_something(self, *args, **kwargs):\n time.sleep(10)\n return {'message': 'OKOK'}\n
\n" }, { "author": { "url": "member/kidlfy", "name": "kidlfy", "avatar": "https://cdn.v2ex.com/avatar/3e87/2256/347016_large.png?m=1536907363" }, "url": "t/512202", "title": "tornado \u600e\u4e48\u80fd\u786e\u4fdd\u7aef\u53e3\u6302\u4e86 \u670d\u52a1\u4e5f\u4e0d\u4f1a\u505c\u6b62\uff1f", "id": "t/512202", "date_published": "2018-11-28T02:00:59+00:00", "content_html": "

\u5c0f\u767d python\ntornado \u4e5f\u4e0d\u719f \u521a\u8bd5\u7740\u7528\n\u9700\u8981\u914d\u7f6e\u4e24\u4e2a\u7aef\u53e3\u6765\u4fdd\u8bc1 \u4e00\u4e2a\u7aef\u53e3\u6302\u4e86\u53e6\u4e00\u4e2a\u4f1a\u8d77\u6765 \u670d\u52a1\u4e0d\u4f1a\u7ec8\u6b62\n\u901a\u8fc7 nginx \u8981\u600e\u4e48\u914d\u7f6e\uff1f\n\u8981\u54ed\u4e86\n\u4e0d\u4f1a\u505a\n\u5f88\u5c34\u5c2c

\n" }, { "author": { "url": "member/everlasting_188", "name": "everlasting_188", "avatar": "https://cdn.v2ex.com/gravatar/810276494571f641863966d535c74c9a?s=73&d=retro" }, "url": "t/467856", "date_modified": "2018-07-03T14:46:57+00:00", "content_html": "", "date_published": "2018-07-03T09:51:59+00:00", "title": "Tornado \u8def\u7531\u6709\u4ec0\u4e48\u597d\u65b9\u6cd5\uff0c\u4e00\u4e2a\u4e00\u4e2a\u5199\u592a\u9ebb\u70e6\u4e86\uff0c\u6709\u6ca1\u6709\u6839\u636e url \u548c\u6ce8\u89e3\u5339\u914d\u7684\u65b9\u6cd5\u5462", "id": "t/467856" }, { "author": { "url": "member/mywaiting", "name": "mywaiting", "avatar": "https://cdn.v2ex.com/avatar/4f87/658e/1340_large.png?m=1733248338" }, "url": "t/350765", "date_modified": "2017-03-27T16:35:11+00:00", "content_html": "\u8bb0\u5f97\u5148\u524d\u6709\u4e2a issue \u63d0\u53ca\u5230 routing \u7684\u95ee\u9898\u7684\uff0c\u6df1\u591c\u7ffb\u4e00\u4e0b Tornado \u7684\u4ee3\u7801\uff0c\u521a\u521a\u597d\u9047\u4e0a update \u5230 v4.5\r
\r
\u591a\u4e86\u8fd9\u4e48\u4e00\u4e2a routing \u7684\u5b9e\u73b0\uff0c\u7ec8\u4e8e\u6709\u4e86\u4e00\u4e2a\u5b98\u65b9\u70b9\u7684\u7a0d\u5fae\u597d\u770b\u4f18\u96c5\u70b9\u7684\u65b9\u5f0f\u53bb\u7ec4\u7ec7 Tornado \u7684 Application \u548c Handler \u4e86\r
\r
\u76f4\u63a5\u770b\u4ee3\u7801\u5427
https://github.com/tornadoweb/tornado/blob/master/tornado/routing.py \u5b98\u65b9\u7684\u6587\u6863\u90fd\u8fd8\u6ca1\u6709\u66f4\u65b0\r
\r
Tornado \u7684\u4ee3\u7801\u5199\u5f97\u633a\u4f18\u96c5\u7684\uff0c\u5f88\u9002\u5408\u56f4\u89c2", "date_published": "2017-03-27T16:33:42+00:00", "title": "Tornado V4.5 release", "id": "t/350765" }, { "author": { "url": "member/lecher", "name": "lecher", "avatar": "https://cdn.v2ex.com/gravatar/51e6526f4f1ab6541a075b0a2d3decc4?s=73&d=retro" }, "url": "t/345167", "title": "pypy \u62ff\u5230\u8d5e\u52a9\u4e4b\u540e\u51fa\u4e86\u652f\u6301 Python3.5 \u7684\u7248\u672c", "id": "t/345167", "date_published": "2017-03-05T15:26:08+00:00", "content_html": "\u770b\u535a\u5ba2\u4e0a\u9762\u7684\u8bc4\u6d4b\uff0c\u6027\u80fd\u8868\u73b0\u5f88\u4e0d\u9519\u3002\r
https://morepypy.blogspot.jp/2017/03/async-http-benchmarks-on-pypy3.html?m=1\r
\r
UVloop \u65b0\u7248\u672c\u4e5f\u5f00\u653e\u4e86\u5bf9 tornado \u7684\u652f\u6301\u3002\r
https://github.com/Magicstack/uvloop/issues/35\r
\r
\u770b\u76ee\u524d\u7f51\u7edc\u4e0a\u9762\u7684\u8bc4\u6d4b sanic+uvloop \u8bc4\u6d4b\u6570\u636e\u9065\u9065\u9886\u5148\u3002\r
\u5982\u679c pypy \u652f\u6301 Python3.5 \u4e4b\u540e\uff0c pypy+uvloop+tornado \u53ef\u4ee5\u8dd1\u51fa\u4ec0\u4e48\u6837\u7684\u6570\u636e\uff1f" }, { "author": { "url": "member/sylvos", "name": "sylvos", "avatar": "https://cdn.v2ex.com/gravatar/5cf33c002b707fe9225a380266a236be?s=73&d=retro" }, "url": "t/332360", "title": "\u8bf7\u6559 tornado \u6587\u4ef6\u4e0a\u4f20\u95ee\u9898", "id": "t/332360", "date_published": "2017-01-05T03:59:03+00:00", "content_html": "\u7528\u4e0b\u9762\u7684\u4ee3\u7801\u505a\u6587\u4ef6\u4e0a\u4f20\uff0c\u5728\u81ea\u5df1\u7535\u8111\u6d4b\u8bd5\u80fd\u591f\u6210\u529f\u4e0a\u4f20\uff0c\u5230\u5c40\u57df\u7f51\u5176\u4ed6\u7535\u8111\u6d4b\u8bd5\uff0c\u663e\u793a finished!\u4e86\uff0c\u4f46\u662f\u6ca1\u770b\u5230\u6587\u4ef6\uff0c\u8bf7\u95ee\u524d\u8f88\uff0c\u662f\u4ec0\u4e48\u539f\u56e0\u5462\uff1f\u8be5\u4ee3\u7801\u8fd0\u884c\u5728 xp \u7cfb\u7edf\u4e0a\uff0c\u4e0a\u4f20\u6587\u4ef6\u5939\u5df2\u8bbe\u7f6e\u6700\u9ad8\u6743\u9650\u3002\r
import tornado.ioloop\r
import tornado.web\r
import shutil\r
import os\r
\r
class UploadFileHandler(tornado.web.RequestHandler):\r
def get(self):\r
self.write('''\r
<html>\r
<head><title>Upload File</title></head>\r
<body>\r
<form action='file' enctype="multipart/form-data" method='post'>\r
<input type='file' name='file'/><br/>\r
<input type='submit' value='submit'/>\r
</form>\r
</body>\r
</html>\r
''')\r
\r
def post(self):\r
upload_path=os.path.join(os.path.dirname(__file__),'files') #\u6587\u4ef6\u7684\u6682\u5b58\u8def\u5f84\r
file_metas=self.request.files['file'] #\u63d0\u53d6\u8868\u5355\u4e2d\u2018 name \u2019\u4e3a\u2018 file \u2019\u7684\u6587\u4ef6\u5143\u6570\u636e\r
for meta in file_metas:\r
filename=meta['filename']\r
filepath=os.path.join(upload_path,filename)\r
with open(filepath,'wb') as up: #\u6709\u4e9b\u6587\u4ef6\u9700\u8981\u5df2\u4e8c\u8fdb\u5236\u7684\u5f62\u5f0f\u5b58\u50a8\uff0c\u5b9e\u9645\u4e2d\u53ef\u4ee5\u66f4\u6539\r
up.write(meta['body'])\r
self.write('finished!')\r
\r
app=tornado.web.Application([\r
(r'/file',UploadFileHandler),\r
])\r
\r
if __name__ == '__main__':\r
app.listen(3000)\r
tornado.ioloop.IOLoop.instance().start()" }, { "author": { "url": "member/feelapi", "name": "feelapi", "avatar": "https://cdn.v2ex.com/avatar/8c06/9f21/36491_large.png?m=1425350253" }, "url": "t/327437", "title": "tornado \u505a\u540e\u53f0\u670d\u52a1\uff0c\u5982\u679c\u524d\u7aef\u6ca1\u6709\u7528 cookie.", "id": "t/327437", "date_published": "2016-12-13T13:48:27+00:00", "content_html": "

\u662f\u4e0d\u662f\u5c31\u4e0d\u7528\u589e\u52a0 XSRF \u7684\u652f\u6301\u4e86\uff0c\u6bd5\u7adf\u8fd9\u4e2a\u8fd8\u662f\u7528\u6765\u5904\u7406 cookie \u7684\u3002

\n" }, { "author": { "url": "member/burnex", "name": "burnex", "avatar": "https://cdn.v2ex.com/avatar/dbe3/bcfb/37711_large.png?m=1393683848" }, "url": "t/321411", "title": "tornado \u4f18\u79c0\u9879\u76ee\u63a8\u8350", "id": "t/321411", "date_published": "2016-11-18T02:58:16+00:00", "content_html": "

\u6253\u7b97\u597d\u597d\u5b66\u4e60\u4e0b tornado \uff0c\u8bf7\u5927\u5bb6\u63a8\u8350\u4e00\u4e9b\u597d\u7684 tornado \u9879\u76ee\uff0c\u8c22\u8c22

\n" }, { "author": { "url": "member/tomhe", "name": "tomhe", "avatar": "https://cdn.v2ex.com/gravatar/cc514dbe148cdb0b2fe1e7c9554b0893?s=73&d=retro" }, "url": "t/300584", "title": "\u95ee\u4e00\u4e2a tornado \u89e3\u51b3\u963b\u585e\u7684\u65b9\u6848\u95ee\u9898\uff1f", "id": "t/300584", "date_published": "2016-08-20T02:25:35+00:00", "content_html": "\u73b0\u5728\u7684\u9700\u6c42\u662f\uff1a\r
\u624b\u673a app \u4e0a\u4f20\u56fe\u7247->tornado \u8c03\u7528 c++\u7b97\u6cd5\u5e93\u5904\u7406->\u5411\u624b\u673a\u8fd4\u56de\u7ed3\u679c\u3002\r
\u76ee\u524d\u9047\u5230\u7684\u95ee\u9898\u662f c++\u7b97\u6cd5\u5e93\u9700\u8981\u8017\u65f6 1 \u79d2\u5de6\u53f3\uff0c\u8fd9\u6837\u4f1a\u628a\u6574\u4e2a tornado \u963b\u585e\u4f4f\u5427\uff1f\u6709\u4ec0\u4e48\u597d\u7684\u5f02\u6b65\u89e3\u51b3\u65b9\u6cd5\u6216\u601d\u8def\u5417\uff1f\r
\u8bf7\u95ee\u6211\u8fd9\u4e2a\u9700\u6c42\u53ef\u4ee5\u7528\u534f\u7a0b\u7684\u65b9\u5f0f\u89e3\u51b3\u5417\uff1f\u8fd8\u662f\u7528\u591a\u8fdb\u7a0b\u7684\u65b9\u5f0f\u89e3\u51b3?" }, { "author": { "url": "member/whoareyou", "name": "whoareyou", "avatar": "https://cdn.v2ex.com/avatar/cee8/c44e/182956_large.png?m=1469075398" }, "url": "t/297680", "title": "tornaqiniu(\u57fa\u4e8e tornado \u7684\u5f02\u6b65\u4e03\u725b sdk)", "id": "t/297680", "date_published": "2016-08-07T05:41:53+00:00", "content_html": "

\u6700\u8fd1\u5728\u7528 Python \u5f00\u53d1\u4e00\u4e2a\u81ea\u5df1\u7684\u7f51\u7ad9\uff0c\u8981\u7528\u5230\u4e03\u725b\u505a\u4e3a\u7f51\u7ad9\u7684 storage \uff0c\u4f46\u662f\u4e03\u725b\u5b98\u65b9 sdk \u4e0d\u652f\u6301\u5f02\u6b65\uff0c\u6240\u4ee5\u6253\u7b97\u81ea\u5df1\u5199\u4e00\u4e2a\u5f02\u6b65\u7684 sdk \u3002\u5199\u51fa\u6765\u4e4b\u540e\u81ea\u5df1\u7528\u7740\u8fd8\u53ef\u4ee5\uff0c\u6240\u4ee5\u60f3\u7ed9\u5927\u5bb6\u5206\u4eab\u4e00\u4e0b\uff0c\u4e0d\u559c\u52ff\u55b7\u3002

\n

python version : >=3.4

\n

github: https://github.com/free-free/tornaqiniu

\n

doc: https://github.com/free-free/tornaqiniu

\n" }, { "author": { "url": "member/aiqier", "name": "aiqier", "avatar": "https://cdn.v2ex.com/gravatar/7722f001ef46dc94410465ebfdf2ac3b?s=73&d=retro" }, "url": "t/289477", "date_modified": "2016-06-30T14:47:11+00:00", "content_html": "

tornado \u53ef\u4ee5\u4f7f\u7528\u5982\u4e0b\u65b9\u5f0f\u5e76\u884c\u5f02\u6b65\u8bf7\u6c42\u3002

\n
@gen.coroutine\ndef get(self):\n http_client = AsyncHTTPClient()\n response1, response2 = yield [http_client.fetch(url1),\n http_client.fetch(url2)]\n
\n

\u8fd9\u4e2a\u65f6\u5019\uff0c 1,2 \u662f\u540c\u65f6\u53d1\u9001\u51fa\u53bb\u7684\uff0c\u4e5f\u5c31\u662f\u8bf4\u4f7f\u7528\u8fd9\u79cd\u65b9\u5f0f\uff0c\u53ef\u4ee5\u8ba9 n \u4e2a\u8bf7\u6c42\uff0c\u540c\u65f6\u53d1\u51fa\u53bb\uff0c\u7b49\u4ed6\u4eec\u90fd\u8fd4\u56de\u4e86\u518d\u7edf\u4e00\u8fd4\u56de\u3002

\n

\u90a3\u4e48\u6211\u8981\u5982\u4f55\u4fdd\u8bc1\uff0c\u5176\u4e2d\u4e00\u4e2a\u8bf7\u6c42\u574f\u4e86\uff0c\u5176\u4f59\u7684\u7ed3\u679c\u4f9d\u65e7\u53ef\u7528\uff1f

\n", "date_published": "2016-06-30T14:46:47+00:00", "title": "tornado \u5e76\u884c\u5f02\u6b65\uff0c\u5982\u4f55\u4fdd\u8bc1\u5728\u53ea\u6709\u90e8\u5206\u8bf7\u6c42\u6210\u529f\u540e\uff0c\u7ed3\u679c\u4f9d\u65e7\u53ef\u7528\u3002", "id": "t/289477" }, { "author": { "url": "member/qiu0130", "name": "qiu0130", "avatar": "https://cdn.v2ex.com/avatar/1e44/2104/139692_large.png?m=1443080447" }, "url": "t/289074", "title": "nginx \u53cd\u5411\u4ee3\u7406 tornado,\u5982\u4f55 location \u9996\u9875\uff55 rl?", "id": "t/289074", "date_published": "2016-06-29T03:54:36+00:00", "content_html": "

nginx\u53cd\u5411\u4ee3\u7406tornado\u5b9e\u4f8b\uff0c\u600e\u4e48\u91cd\u5b9a\u5411\u5230\u9996\u9875url

\n" }, { "author": { "url": "member/mgna17", "name": "mgna17", "avatar": "https://cdn.v2ex.com/avatar/cdc8/3877/144263_large.png?m=1445743013" }, "url": "t/283654", "date_modified": "2016-06-05T09:26:59+00:00", "content_html": "

\u521a\u5f00\u59cb\u5b66 tornado \uff0c\u5b83\u7684\u5f02\u5e38\u5904\u7406\u673a\u5236\u6709\u70b9\u5f04\u4e0d\u660e\u767d\u3002

\n

\u5199\u4e86\u4e00\u4e2a\u6d4b\u8bd5\u7528\u7684\u5c0f\u811a\u672c\uff0c\u671f\u671b\u9047\u5230 404 \u7684\u65f6\u5019\u80fd\u591f\u89e6\u53d1\u6211\u81ea\u5df1\u58f0\u660e\u7684 write_error \u51fd\u6570\uff0c\u7136\u800c write_error \u5e76\u6ca1\u6709\u751f\u6548\uff0c\u8f93\u51fa\u7684\u662f tornado \u9ed8\u8ba4\u7684 404 \u9875\u9762\u3002

\n

\u4ee3\u7801\u5982\u4e0b\uff1a

\n
#!/bin/env python3.5\n#coding:utf-8\nimport os\n\nimport tornado.httpserver\nimport tornado.ioloop\nimport tornado.options\nimport tornado.web\n\nfrom tornado.options import define, options\n\ndefine(\"port\", default=8000, help=\"\u7aef\u53e3\", type=int)\n\nclass BaseHandler(tornado.web.RequestHandler):\n def write_error(self, stat, **kw):\n self.write('Func write_error !')\n\n\nclass IndexHandler(BaseHandler):\n def get(self):\n self.write('hello')\n\nhandlers = [ \n (r'/index', IndexHandler),\n ] \n\nsettings = { \n 'template_path': os.path.join(os.path.dirname(__file__), \"templates\"),\n 'static_path': os.path.join(os.path.dirname(__file__), 'static'),\n }\n\nif __name__ == '__main__':\n tornado.options.parse_command_line()\n app = tornado.web.Application(handlers=handlers, **settings)\n http_server = tornado.httpserver.HTTPServer(app)\n http_server.listen(options.port)\n print(options.port)\n tornado.ioloop.IOLoop.instance().start()\n
\n

\u7136\u540e\u53bb google \u4e86\u4e00\u4e0b\uff0c\u628a BaseHandler \u6210\u4e86\u8fd9\u6837\uff0c\u4f46\u662f 404 \u7684\u65f6\u5019\u8fd8\u662f\u8fd4\u56de\u4e86\u9ed8\u8ba4\u7684 404 \u9875\u9762\uff1a

\n
class BaseHandler(tornado.web.RequestHandler):\n def _handle_request_exception(self, e):\n self.write_error(404)\n\n def send_error(self, stat, **kw):\n self.write_error(404)\n\n def write_error(self, stat, **kw):\n self.write('Func write_error !')\n
\n", "date_published": "2016-06-05T09:07:42+00:00", "title": "\u95ee\u4e00\u4e2a\u5173\u4e8e tornado \u5f02\u5e38\u5904\u7406\u7684\u65b0\u624b\u95ee\u9898", "id": "t/283654" }, { "author": { "url": "member/triThirty", "name": "triThirty", "avatar": "https://cdn.v2ex.com/avatar/464b/8ffa/122253_large.png?m=1441520884" }, "url": "t/269198", "title": "tornado \u7684 coroutine \u80fd\u548c\u81ea\u5b9a\u4e49\u7684\u88c5\u9970\u5668\u4e00\u8d77\u4f7f\u7528\u5417\uff1f\uff1f", "id": "t/269198", "date_published": "2016-04-07T03:45:17+00:00", "content_html": "

\u8bd5\u4e86\u4e0b\u4f7f\u7528 tornado \u7684 coroutine \u548c\u81ea\u5df2\u5b9a\u4e49\u7684\u4e00\u4e2a decorator \u4e00\u8d77\u4f7f\u7528\uff0c\u4f46\u53d1\u73b0\u4e0d\u4f1a\u5728 yield \u51fa\u6302\u8d77\uff0c\u800c\u662f\u5411\u4e0a\u8fd4\u56de\u3002\n\u5c31\u662f\u8bf4\uff0c\u5982\u679c\u6709\u591a\u5c42\u5d4c\u5957\u7684\u8bdd\uff0c\u5728\u8fd0\u884c\u5230\u6700\u5e95\u5c42\u7684 yield \u5904\u4e4b\u540e\uff0c\u7a0b\u5e8f\u4e0d\u4f1a\u8fd0\u884c yield \u4e4b\u540e\u7684\u4ee3\u7801\uff0c\u800c\u662f\u5411\u4e0a\u8fd4\u56de\u4e00\u4e2a\u7a7a\u7684 future \uff0c\u800c\u4e14\u4e0a\u5c42\u4ee3\u7801\u4e5f\u4e0d\u4f1a\u6267\u884c yield \u4e4b\u540e\u7684\u4ee3\u7801\u800c\u662f\u7ee7\u7eed\u5411\u4e0a\u8fd4\u56de\u3002\n\u4e0d\u77e5\u9053\u6709\u6ca1\u6709\u5927\u795e\u80fd\u7ed9\u51fa\u4e00\u4e2a\u4f8b\u5b50\uff0c\u5c06 coroutine \u548c\u81ea\u5b9a\u4e49\u7684\u88c5\u9970\u5668\u4e00\u8d77\u4f7f\u7528\u7684\u4f8b\u5b50\uff0c\u6216\u8005\u8bf4\u80fd\u6307\u51fa\u600e\u4e48\u4f7f\u7528\u3002\u8c22\u8c22

\n" }, { "author": { "url": "member/bluesky139", "name": "bluesky139", "avatar": "https://cdn.v2ex.com/avatar/119f/6887/72959_large.png?m=1432863459" }, "url": "t/250767", "title": "Tornado \u5e76\u53d1\u6570\u5f88\u4f4e\uff0c\u6b63\u5e38\u4e48\uff1f", "id": "t/250767", "date_published": "2016-01-14T09:47:48+00:00", "content_html": "\u5728 localhost \u4e0b\u6d4b\u8bd5\uff0c\u50cf demo \u4e00\u6837\uff0c get \u6216 post \u91cc\u9762\u6ca1\u6709\u4efb\u4f55\u591a\u4f59\u7684\u8017\u65f6\u4ee3\u7801\uff0c\u76f4\u63a5\u8fd4\u56de\u3002\r
\u5f97\u5230\u7684\u7ed3\u679c\u662f\u6bcf\u79d2 200 \u591a\u7684\u5e76\u53d1\u6570\uff0c\u8fd9\u6b63\u5e38\u4e48\uff1f\r
\r
\u76ee\u524d\u7cfb\u7edf\u662f win7 \uff0c CPU \u662f E3 1231 \uff0c\r
\u4ece\u4efb\u52a1\u7ba1\u7406\u5668\u6765\u770b\uff0c\u4f3c\u4e4e\u662f\u5355\u7ebf\u7a0b\u8dd1\u6ee1\u4e86\uff08\u56e0\u4e3a\u8fdb\u7a0b\u7684 CPU \u5360\u7528\u7387\u4e3a 13 \uff09\u3002\r
\u5404\u4f4d\u7528 tornado \u7684\u670b\u53cb\u4e5f\u662f\u540c\u6837\u7684\u7ed3\u679c\u4e48? \u8fd8\u662f\u8bf4\u54ea\u91cc\u6709\u5751\uff1f" }, { "author": { "url": "member/kidlj", "name": "kidlj", "avatar": "https://cdn.v2ex.com/avatar/7d66/788d/48786_large.png?m=1735461327" }, "url": "t/248581", "title": "\u9605\u8bfb Tornado \u6e90\u7801\u8fc7\u7a0b\u4e2d\u7684\u4e00\u4e2a\u7591\u60d1\uff0c\u6c42\u89e3\u7b54", "id": "t/248581", "date_published": "2016-01-05T11:50:34+00:00", "content_html": "

\u4e0b\u9762\u662f tornado.httpclient.AsyncHTTPClient\u7c7b\u7684 fetch()\u65b9\u6cd5\u7684\u6e90\u4ee3\u7801\u3002\u6211\u6ca1\u6709\u5728\u91cc\u9762\u627e\u5230\u4efb\u4f55"fetch"\u7684\u52a8\u4f5c\uff0c\u5b83\u662f\u600e\u4e48\u5b9e\u73b0 \u201c Executes a request, asynchronously returning an HTTPResponse\u201d\u7684\uff1f

\n\n

\u5b8c\u6574\u4ee3\u7801\u5728\uff1a https://github.com/tornadoweb/tornado/blob/master/tornado/httpclient.py

\n
def fetch(self, request, callback=None, raise_error=True, **kwargs):\n """Executes a request, asynchronously returning an `HTTPResponse`.\n The request may be either a string URL or an `HTTPRequest` object.\n If it is a string, we construct an `HTTPRequest` using any additional\n kwargs: ``HTTPRequest(request, **kwargs)``\n This method returns a `.Future` whose result is an\n `HTTPResponse`. By default, the ``Future`` will raise an\n `HTTPError` if the request returned a non-200 response code\n (other errors may also be raised if the server could not be\n contacted). Instead, if ``raise_error`` is set to False, the\n response will always be returned regardless of the response\n code.\n If a ``callback`` is given, it will be invoked with the `HTTPResponse`.\n In the callback interface, `HTTPError` is not automatically raised.\n Instead, you must check the response's ``error`` attribute or\n call its `~HTTPResponse.rethrow` method.\n """\n if self._closed:\n raise RuntimeError("fetch() called on closed AsyncHTTPClient")\n if not isinstance(request, HTTPRequest):\n request = HTTPRequest(url=request, **kwargs)\n else:\n if kwargs:\n raise ValueError("kwargs can't be used if request is an HTTPRequest object")\n # We may modify this (to add Host, Accept-Encoding, etc),\n # so make sure we don't modify the caller's object. This is also\n # where normal dicts get converted to HTTPHeaders objects.\n request.headers = httputil.HTTPHeaders(request.headers)\n request = _RequestProxy(request, self.defaults)\n future = TracebackFuture()\n if callback is not None:\n callback = stack_context.wrap(callback)\n\n def handle_future(future):\n exc = future.exception()\n if isinstance(exc, HTTPError) and exc.response is not None:\n response = exc.response\n elif exc is not None:\n response = HTTPResponse(\n request, 599, error=exc,\n request_time=time.time() - request.start_time)\n else:\n response = future.result()\n self.io_loop.add_callback(callback, response)\n future.add_done_callback(handle_future)\n\n def handle_response(response):\n if raise_error and response.error:\n future.set_exception(response.error)\n else:\n future.set_result(response)\n self.fetch_impl(request, handle_response)\n return future\n\ndef fetch_impl(self, request, callback):\n raise NotImplementedError()\n
\n" }, { "author": { "url": "member/alex8224", "name": "alex8224", "avatar": "https://cdn.v2ex.com/avatar/7ffb/18ac/17501_large.png?m=1736415336" }, "url": "t/248278", "title": "gtornado - tornado \u4e2d pymysql, pymemcache, storm orm \u652f\u6301\u5e93", "id": "t/248278", "date_published": "2016-01-04T10:05:05+00:00", "content_html": "

\u76ee\u524d\u9002\u914d\u4e86 pymysql, pymemcache \u548c storm \u7684\u5f02\u6b65\u5316\u652f\u6301.

\n\n

\u66f4\u591a\u8be6\u7ec6\u4fe1\u606f\u53ef\u8bbf\u95ee: https://github.com/alex8224/gtornado

\n" }, { "author": { "url": "member/mywaiting", "name": "mywaiting", "avatar": "https://cdn.v2ex.com/avatar/4f87/658e/1340_large.png?m=1733248338" }, "url": "t/239245", "title": "Tornado \u5982\u4f55\u7ec4\u7ec7\u4e2d\u5927\u578b\u9879\u76ee\uff0c\u4f60\u4eec\u90fd\u662f\u600e\u4e48\u6837\u505a\u7684\uff1f", "id": "t/239245", "date_published": "2015-11-26T14:24:16+00:00", "content_html": "\u7528\u4e86 tornado \u4e5f\u5199\u7f51\u7ad9\uff0c\u65e0\u5b83\uff0c\u5f53\u521d\u5c31\u662f\u56e0\u4e3a\u559c\u6b22\uff0c\u56e0\u4e3a tornado \u7684\u4ee3\u7801\u5199\u5f97\u771f\u5fc3\u6f02\u4eae\u3002\r
\r
\u4e00\u5f00\u59cb\u6211\u662f\u8fd9\u6837\u7ec4\u7ec7\u9879\u76ee\u7684\uff0c\u4f60\u6ca1\u6709\u770b\u9519\uff0c\u771f\u5fc3\u53ea\u6709\u8fd9\u51e0\u4e2a\u6587\u4ef6\uff1a\r
\r
+ project\r
| - app.py \uff08\u57fa\u672c\u6240\u6709\u7684 handler \u90fd\u5728\u8fd9\u91cc\u4e86\uff09\r
| - models.py \uff08\u6570\u636e\u5e93\u76f8\u5173\u7684\uff09\r
| + templates \r
| + static\r
\r
\u5982\u679c\u8981\u7ed9\u4e2a\u53c2\u8003\u4f8b\u5b50\uff0c\u90a3 BT \u5927\u5927\u7684\u9879\u76ee\u6765\u53c2\u8003\u5427 https://github.com/finiteloop/socialcookbook \u521a\u521a\u5f00\u59cb\u5199 tornado \u7684\u9879\u76ee\u7684\u65f6\u5019\u6ca1\u6709\u90a3\u4e48\u591a\u7684\u4e1c\u897f\uff0c\u4e00\u5207\u90fd\u5f88\u7b80\u6d01\u5f88\u7f8e\u597d\uff01\r
\r
\u7136\u540e\u5462\uff0c\u9879\u76ee\u8d8a\u6765\u8d8a\u591a\u529f\u80fd\u4e86\uff0c\u9700\u8981\u7ec4\u7ec7\u7684\u4ee3\u7801\u8d8a\u6765\u8d8a\u591a\uff0c\u9700\u8981 Seesion \uff0c\u9700\u8981 form \u68c0\u9a8c\u7b49\u4e00\u5806\u4e1c\u897f\uff0c\u4e8e\u662f\u91cd\u6784\u4e3a\u8fd9\u6837\u6765\u7ec4\u7ec7\u9879\u76ee\uff1a\r
\r
+ project\r
| + controllers\r
| | - acontroller.py\r
| | - bcontroller.py\r
| | ....\r
| + models\r
| | - amodel.py\r
| | - bmodel.py\r
| | ....\r
| + templates\r
| + forms\r
| | - aform.py\r
| | - bform.py\r
| | ....\r
| + helpers\r
| | - ahelper.py\r
| | - bhelper.py\r
| | ....\r
| - application.py \r
| - urls.py\r
| - settings.py\r
\r
\u5f88\u76f4\u63a5\u4e5f\u5f88\u660e\u663e\uff0c\u8fd9\u662f\u62ff Tornado \u6765\u505a MVC \u8fd9\u9f8c\u9f8a\u7684\u4e8b\u60c5\u4e86\uff0c\u628a\u5148\u524d\u8d8a\u6765\u8d8a\u5927\u7684 app.py \u5206\u5f00\u6210 controllers \u76ee\u5f55\uff0c models \u76ee\u5f55\u9875\u4e00\u6837\uff0c\u589e\u52a0\u4e86 forms \u76ee\u5f55\u548c helpers \u76ee\u5f55\u3002 application.py \u653e\u7f6e\u6574\u4e2a project \u7684\u542f\u52a8\u3001\u5173\u95ed\uff0c URL \u653e\u5728 urls.py \uff0c settings \u561b\u5c31\u662f\u914d\u7f6e\u3002\r
\r
\u8fd9\u6837\u5b89\u597d\u8fd0\u884c\u4e86\u597d\u957f\u4e00\u6bb5\u65f6\u95f4\uff0c\u6bd5\u7adf\u4e00\u4e2a\u5c0f\u7f51\u7ad9\uff0c\u957f\u6210\u8fd9\u6837\u5df2\u7ecf\u5f88\u5bf9\u5f97\u8d77\u6211\u62ff\u7684\u5de5\u8d44\u4e86\u3002\u4f46\u662f\u8fd9\u6837\u7684\u9879\u76ee\u7ed3\u6784\u968f\u7740\u4e1a\u52a1\u7684\u589e\u591a\u611f\u89c9\u8d8a\u6765\u8d8a\u529b\u4e0d\u4ece\u5fc3\uff1a\r
\r
1 \u3001\u9996\u5148\u4e1a\u52a1\u5173\u8054\u6bd4\u8f83\u591a\uff0c\u7c7b\u4f3c\u4e8e\u95e8\u6237\u7f51\u7ad9\u90a3\u6837\u7684 CMS \u7c7b\u578b\u7684\uff0c\u8fd9\u6837\u5c31\u65e0\u6cd5\u5206\u51fa\u51e0\u4e2a\u9879\u76ee\u6765\u5e94\u7528\u4e0a\u9762\u7684\u4ee3\u7801\u7ec4\u7ec7\u4e86\u3002\r
2 \u3001\u5b50\u57df\u540d\u7684\u9700\u6c42\u4f17\u591a\uff0c\u57fa\u672c\u4e00\u4e2a\u5b50\u57df\u540d a.example.com \u548c b.example.com \u7684\u4ee3\u7801\u903b\u8f91\u662f\u5b8c\u5168\u4e0d\u4e00\u6837\u7684\uff0c\u4f46\u662f\u6570\u636e\u5e93\u540e\u9762\u7684\u6570\u636e\u5374\u6709\u5f88\u591a\u9700\u6c42\u91cd\u5408\u7684\u3002\u540c\u65f6\u539f\u56e0\u89c1 1 \uff0c\u53c8\u65e0\u6cd5\u5206\u51fa\u597d\u51e0\u4e2a project \u6765\u7ec4\u7ec7\u4ee3\u7801\r
\r
\u611f\u89c9\u8d8a\u6765\u8d8a\u81c3\u80bf\u7684\u4ee3\u7801\u7ed3\u6784\uff0c\u8d8a\u6765\u8d8a\u591a\u7684\u4e1c\u897f\u52a0\u5165\u5230 Tornado \u8fd9\u4e2a\u5927\u6742\u70e9\u91cc\u9762\uff0c\u611f\u89c9\u9879\u76ee\u957f\u5f97\u8d8a\u6765\u8d8a\u50cf Django \u7684\u9879\u76ee\uff0c\u4f46\u662f\u7ec4\u7ec7\u5374\u8fdc\u4e0d\u5982 Django \u7684\u9879\u76ee\u7ec4\u7ec7\u5f97\u597d\uff01\r
\r
\u770b\u4e86\u4e00\u4e0b Flask \u7684 Blueprint \uff0c\u8fd9\u8d27\u8c8c\u4f3c\u5728\u67b6\u6784\u5927\u578b\u9879\u76ee\u7684\u65f6\u5019\u5f88\u5b9e\u7528\u7684\u6837\u5b50\u3002\r
\r
\u5c31\u50cf\u8fd9\u7bc7\u6587\u7ae0 https://spacewander.github.io/explore-flask-zh/7-blueprints.html \u8bf4\u5230\u7684\u6309\u7167\u529f\u80fd(functional)\u6216\u8005\u5206\u533a(divisional)\u6765\u7ec4\u7ec7\u4ee3\u7801\u3002\r
\r
\u6309\u7167 \u5206\u533a(divisional) \u6765\u7ec4\u7ec7\u4ee3\u7801\u8c8c\u4f3c\u6709\u5929\u751f\u7684\u9002\u5408\u5927\u578b\u7684\u4e14\u5185\u90e8\u53ef\u4ee5\u677e\u8026\u5408\u7684\u9879\u76ee\uff0c\u800c\u7c7b\u4f3c\u6211\u4e0a\u9762\u7684 \u6309\u7167\u529f\u80fd(functional) \u6765\u7ec4\u7ec7\u9879\u76ee\u5c31\u9002\u5408\u7ec4\u7ec7\u529f\u80fd\u76f8\u5bf9\u5185\u805a\u7684\u9879\u76ee\u3002\r
\r
\u6309\u7167\u6211\u8fd9\u4e48\u91cd\u6784\u4e0b\u53bb\uff0c\u8fdf\u65e9\u8981\u5f04\u4e2a Django \u51fa\u6765\u7684\u611f\u89c9\u3002\u6709\u70b9\u540e\u6094\u5f53\u521d\u600e\u4e48\u4e0d\u76f4\u63a5\u7528 Django \u800c\u7528\u4e0a\u4e86 Tornado \u6765\u81ea\u5df1\u9020\u5404\u79cd\u8f6e\u5b50\u3002\r
\r
\u5404\u4f4d\u5728\u67b6\u6784 Tornado \u7684\u4e2d\u5927\u578b\u9879\u76ee\uff0c\u6709\u4ec0\u4e48\u7ecf\u9a8c\u53ef\u4ee5\u5206\u4eab\u5417\uff1f\r
\r
\u8c22\u8c22\uff01" }, { "author": { "url": "member/lydhr", "name": "lydhr", "avatar": "https://cdn.v2ex.com/avatar/5bff/155d/76751_large.png?m=1668374122" }, "url": "t/238241", "title": "tornado \u8dd1\u4e0d\u901a\uff0c\u5c0f\u767d\u6c42\u5e2e\u5fd9", "id": "t/238241", "date_published": "2015-11-23T06:16:10+00:00", "content_html": "

Context \uff1a
\n- tornado \u7684 helloWorld \u6559\u7a0b\u4ee3\u7801\u8dd1\u4e0d\u901a\uff0c localhost:8000 \u4f1a\u62a5\u9519\u2018\u672a\u6536\u5230\u6570\u636e\u2019

\n- \u672c\u673a\u5e76\u672a\u88c5 Nginx \uff0c\u4f46\u662f 0.0.0.0 \u6253\u5f00\u540e\u4f1a\u663e\u793a Welcome to nginx!\u90a3\u4e2a\u6b22\u8fce\u9875

\n- terminal \u4e2d\uff0c nginx command not found

\nQuestion \uff1a
\n- \u5982\u4f55\u5b9a\u4f4d\u81ea\u5df1\u7684 nginx \u8f6c\u5230\u54ea\u91cc\u4e86\uff1f
\n- tornado \u7684 helloWorld \u54ea\u91cc\u4e0d\u5bf9\uff1f

\n" }, { "author": { "url": "member/Gem", "name": "Gem", "avatar": "https://cdn.v2ex.com/gravatar/4506e57d77d4bba333eaa2c9ba89551c?s=73&d=retro" }, "url": "t/234457", "title": "Tornado 4.3 \u53d1\u5e03", "id": "t/234457", "date_published": "2015-11-07T11:53:58+00:00", "content_html": "Highlights: The new async/await keywords in Python 3.5 are supported. \r
\r
In most cases, async def can be used in place of the @gen.coroutine decorator. Inside a function defined with async def, use await instead of yield to wait on an asynchronous operation. Coroutines defined with async/await will be faster than those defined with @gen.coroutine and yield.\r
\r
But do not support some features including Callback/Wait or the ability to yield a Twisted Deferred. See the users \u2019 guide for more.\r
\r
\r
http://www.tornadoweb.org/en/stable/releases/v4.3.0.html" }, { "author": { "url": "member/Gem", "name": "Gem", "avatar": "https://cdn.v2ex.com/gravatar/4506e57d77d4bba333eaa2c9ba89551c?s=73&d=retro" }, "url": "t/233912", "title": "Tornado \u5b98\u65b9\u600e\u4e48\u4e0d\u597d\u597d\u7ef4\u62a4\u4e00\u4e2a sql \u7684\u5f02\u6b65\u6570\u636e\u5e93\u9a71\u52a8\uff1f", "id": "t/233912", "date_published": "2015-11-05T09:18:38+00:00", "content_html": "\u867d\u7136\u8fd9\u6837\u663e\u5f97 Tornado \u66f4\u52a0\u7eaf\u7cb9\u4e86\uff0c\u53ef\u662f\u5728\u7528\u6237\u5b9e\u9645\u4f7f\u7528\u8d77\u6765\uff0c\u8fd8\u662f\u6709\u5f88\u591a\u4e0d\u4fbf\uff0c\u793e\u533a\u91cc\u9762\u4e5f\u6ca1\u6709\u6bd4\u8f83\u9ad8 star \u7684\u5b9e\u73b0\u3002" }, { "author": { "url": "member/dai269619118", "name": "dai269619118", "avatar": "https://cdn.v2ex.com/avatar/8f4d/e6d2/40453_large.png?m=1750644025" }, "url": "t/228298", "date_modified": "2015-10-15T08:30:11+00:00", "content_html": "
def get(self):\n time.sleep(100)\n self.write('hello test')\n
\n\n

\u5982\u679c\u7a0b\u5e8f\u6267\u884c\u7684\u65f6\u5019\u4e2d\u95f4\u5904\u7406\u4e00\u4e2a\u9700\u8981\u5f88\u591a\u65f6\u95f4\uff0c\u8fd9\u4e2a\u65f6\u5019\u6709\u4e00\u4e2a\u65b0\u7684\u8bf7\u6c42
\n\u90a3\u4e48\u7b2c\u4e8c\u4e2a\u8bf7\u6c42\u9700\u8981\u7b49\u5f85\u7b2c\u4e00\u4e2a\u8bf7\u6c42\u6267\u884c\u5b8c\u624d\u5f00\u59cb\u6267\u884c\u7b2c\u4e8c\u4e2a\u64cd\u4f5c
\n\u63a5\u7740\u7528 nginx \u505a\u4e86\u4e00\u4e2a\u8d1f\u8f7d\u5747\u8861\uff0c\u5f00\u4e86 3 \u4e2a tornado

\n
upstream to.com{\n server 127.0.0.1:8887;\n server 127.0.0.1:8888;\n server 127.0.0.1:8889;\n }\n
\n\n

\u53ef\u662f\u4e2d\u95f4\u8fd8\u662f\u6709\u673a\u7387\u5207\u5230\u540c\u4e00\u4e2a\u7aef\u53e3\u4e0a\u9762\uff0c\u7136\u540e\u53c8\u8981\u7b49\u5f85\u5904\u7406\uff0c\u6709\u4ec0\u4e48\u5176\u4ed6\u5904\u7406\u65b9\u9762\u5417\uff1f

\n", "date_published": "2015-10-15T08:11:43+00:00", "title": "\u5173\u4e8e tornado \u963b\u585e\u7684\u95ee\u9898", "id": "t/228298" }, { "author": { "url": "member/sujin190", "name": "sujin190", "avatar": "https://cdn.v2ex.com/avatar/e66f/964a/36127_large.png?m=1732868751" }, "url": "t/226295", "title": "tornado \u7684 mysql \u5f02\u6b65\u9a71\u52a8\u6027\u80fd\u6d4b\u8bd5", "id": "t/226295", "date_published": "2015-10-08T05:50:58+00:00", "content_html": "
https://gist.github.com/mosquito/aa20b94fec8b406d9a51
" }, { "author": { "url": "member/sujin190", "name": "sujin190", "avatar": "https://cdn.v2ex.com/avatar/e66f/964a/36127_large.png?m=1732868751" }, "url": "t/219815", "title": "pypy \u4e4b tornado", "id": "t/219815", "date_published": "2015-09-10T15:24:11+00:00", "content_html": "\u5728 pypy \u4e0b\u6d4b\u8bd5\u4e86\u4e0b tornado \uff0c\u6ca1\u6709\u6570\u636e\u5e93\u7684\u60c5\u51b5\u4e0b ab -c1000 \u53ef\u4ee5\u8dd1\u5230 20000 \u591a qps \uff0c\u5e26 mysql \u67e5\u8be2\u5355\u884c\u4e24\u4e2a\u5b57\u6bb5\u7684\u6570\u636e\u4e5f\u80fd\u8dd1\u5230 1000 \u5de6\u53f3 qps \uff0c pypy \u5bf9 torndao \u7684\u63d0\u5347\u8fd8\u662f\u633a\u591a\u7684\u554a\u3002\r
\u4f7f\u7528\u7684\u662f\u5b98\u7f51\u7684\u793a\u4f8b\uff0c i5 \u56db\u6838 8g \uff0c mysql \u9ed8\u8ba4\u914d\u7f6e" }, { "author": { "url": "member/xlzd", "name": "xlzd", "avatar": "https://cdn.v2ex.com/avatar/fa99/2dd3/108641_large.png?m=1459071920" }, "url": "t/211788", "date_modified": "2015-08-08T11:28:51+00:00", "content_html": "

\u8bf7\u95ee\u5404\u4f4d, \u670d\u52a1\u5668\u7aef\u7528\u7684tornado, \u5047\u5982\u51e0\u4e2adomain\u90fd\u6307\u5411\u4e86\u540c\u4e00\u4e2a\u5730\u5740, \u5e94\u8be5\u600e\u4e48\u5f97\u5230\u88ab\u8bbf\u95ee\u7684\u57df\u540d\u5462?

\n", "date_published": "2015-08-08T11:19:47+00:00", "title": "tornado \u591a\u4e2a url", "id": "t/211788" }, { "author": { "url": "member/roychan", "name": "roychan", "avatar": "https://cdn.v2ex.com/gravatar/81a46497b9e8abce7479fe40d7bf8f7b?s=73&d=retro" }, "url": "t/208772", "date_modified": "2015-07-27T15:45:41+00:00", "content_html": "

\u521a\u521a\u5f00\u59cb\u7528 Tornado\u3002

\n\n

\u5728\u7528\u6237\u8ba4\u8bc1\u65f6\uff0c\u6211\u8986\u5199\u4e86 BaseHandler\uff0c\u4ee5\u4fbf\u4f7f\u7528\u5185\u7f6e\u7684 current_user() \u65b9\u6cd5\u4e0e is_authenticated \u4fee\u9970\u5668\u3002

\n
class BaseHandler(tornado.web.RequestHandler):\n def get_current_user(self):\n return self.get_secure_cookie('user')\n
\n\n

\u5728\u67d0\u6b65\u4e2d\uff0c\u6211\u52a0\u4e86\u5224\u65ad if self.current_user then xxx\uff0c\u6b64\u65f6\u5373\u4fbf\u767b\u5f55\u4e86\u4e5f\u65e0\u6cd5\u6267\u884c xxx\uff0c\u5982\u679c\u6211\u628a\u5224\u65ad\u5199\u6210 if self.get_current_user then xxx\uff0c\u4fbf\u80fd\u6210\u529f\u786e\u8ba4\u767b\u5f55\uff0cxxx \u5c31\u6267\u884c\u4e86\u3002

\n\n

\u8bf7\u95ee\u8fd9\u53ef\u80fd\u662f\u4ec0\u4e48\u95ee\u9898\uff1f

\n", "date_published": "2015-07-27T15:43:49+00:00", "title": "RequestHandler \u7c7b\u7684 get_current_user() \u65b9\u6cd5\u8986\u5199\u65e0\u6548", "id": "t/208772" }, { "author": { "url": "member/agentwx", "name": "agentwx", "avatar": "https://cdn.v2ex.com/avatar/228e/bc0d/78510_large.png?m=1468483025" }, "url": "t/206354", "title": "tornado \u52a8\u6001\u6dfb\u52a0 url \u7684\u95ee\u9898", "id": "t/206354", "date_published": "2015-07-17T05:04:14+00:00", "content_html": "

\u6700\u8fd1\u5728\u770btornado \uff0c \u770b\u5230\u5b83\u7684url\u7684\u5904\u7406\u65b9\u5f0f\uff0c\u4e00\u822c\u662furl(r"/path",sthhandler),\u7a81\u7136\u5fc3\u91cc\u60f3\u5230\u80fd\u4e0d\u80fd\u76f4\u63a5\u52a8\u6001\u521b\u5efa\u8fd9\u4e2aurl\uff0csthhandler\u4e00\u822c\u90fd\u662f\u4e00\u4e2a\u7c7b\uff0c\u5982\u679c\u52a8\u6001\u521b\u5efa\u4e86\u4e00\u4e2aurl, \u76f8\u5e94\u7684handler\u5982\u4f55\u52a8\u6001\u751f\u6210\u5462\uff1f \u76f4\u63a5\u4ee5py\u6587\u4ef6\u7684\u5f62\u5f0f\u751f\u6210\uff1f

\n" }, { "author": { "url": "member/evolsnow", "name": "evolsnow", "avatar": "https://cdn.v2ex.com/avatar/ae52/b061/29293_large.png?m=1472388707" }, "url": "t/199922", "date_modified": "2015-06-19T13:40:40+00:00", "content_html": "

\u5728/test\u7684handler\u6dfb\u52a0\u4e86@tornado.web.authenticated, \u672a\u767b\u5f55\u8bbf\u95ee\u65f6\u8df3\u8f6c\u5230\u8bbe\u7f6e\u7684/login.
\n\u6b64\u65f6\u7f51\u5740\u4e3a"/login?next=%2Ftest", \u867d\u7136\u8bbe\u7f6e\u4e86:self.redirect(self.get_argument("next", "/"))
\n\u4f46\u662f\u767b\u5f55\u540e\u4e0d\u8fd4\u56de\u81f3"/test"\u800c\u662f\u5230\u4e86\u9ed8\u8ba4\u7684"/"\u9875\u9762

\n\n

\u7f51\u4e0a\u641c\u7d22\u65e0\u679c,\u95ee\u9898\u548c\u8fd9\u5927\u54e5\u4e00\u6837:
\nhttp://stackoverflow.com/questions/20290020/tornado-next-query-string-url-parameter
\n\u4e0d\u8fc7\u8be5\u7b54\u6848\u5e76\u672a\u89e3\u51b3\u95ee\u9898, \u6240\u4ee5\u7ee7\u7eed\u6765v\u7ad9\u6c42\u89e3

\n", "date_published": "2015-06-19T13:38:40+00:00", "title": "tornado \u600e\u4e48\u5229\u7528'next'\u53c2\u6570\u8fdb\u884c\u9875\u9762\u8df3\u8f6c", "id": "t/199922" }, { "author": { "url": "member/wolegequ", "name": "wolegequ", "avatar": "https://cdn.v2ex.com/gravatar/51bcbbe0ce50821e1aedd9c1c1c9e674?s=73&d=retro" }, "url": "t/199311", "title": "finish() called twice", "id": "t/199311", "date_published": "2015-06-17T09:18:49+00:00", "content_html": "\u62b1\u6b49,\u6807\u9898\u7565\u542b\u7cca.\r
\r
\u6709\u4e24\u4e2a\u8fd4\u56dejson\u63a5\u53e3\r
http://example.com/api/user/uid\r
http://example.com/api/user/uid/fun\r
\r
\u672c\u6253\u7b97\u5982\u6b64\u5b9e\u73b0 handles \r
(r'/api/user/(.*)', user.fun1),\r
(r'/api/user/(.*)/fun2', user.fun2 ),\r
\r
\u641e\u4e86\u534a\u5929,\u53d1\u73b0 user.fun1 \u6839\u672c\u4e0d\u4f1a\u8c03\u7528 ......\r
\r
\u4e8e\u662f\u4e4e\u6539\u4e3a\u8fd9\u6837\r
\r
(r'/api/user/(.*)', user.funs ),\r
\r
\r
class funs(BaseController):\r
\r
@tornado.web.asynchronous\r
def get(self, params):\r
\r
if 'fun' in params:\r
self.fun2\r
else:\r
self.fun1\r
\r
\u60ca\u5947\u7684\u53d1\u73b0 it works !!!(\u867d\u7136\u5f88\u5c71\u5be8...)\r
\r
\u91cd\u70b9\u6765\u4e86 !!!!\r
\r
\u5ba2\u6237\u7aef\u4e24\u4e2a\u63a5\u53e3\u5148\u540e\u51e0\u4e4e\u540c\u65f6\u8bf7\u6c42\r
\r
self.fun1 self.fun2\u6700\u540e\u90fd\u4f1a\u8c03\u7528 self.finish(),\r
\r
\u4e8e\u662f\u4e4e\u51fa\u73b0\u4e86 finish() called twice - - !\r
\r
\u540e\u6765\u770b\u5230\u6709\u8bf4\u6cd5@tornado.web.asynchronous \u662f\u4e0d\u53ef\u4ee5self.finish()\u7684\r
\r
\u4e8e\u662f\u4e4e\u6539\u4e3aself.fun1 self.fun2\u6700\u540e\u90fd\u8c03\u7528 self.write(),\r
\r
\u6ca1\u6709 finish() called twice\u4e86,\u4f46\u662f\u6709\u4e00\u4e2a\u63a5\u53e3\u4e00\u76f4\u6ca1\u6570\u636e\u8fd4\u56de(\u5355\u72ec\u8bf7\u6c42\u4efb\u610f\u4e00\u4e2a\u90fd\u6b63\u5e38!)\r
\r
\u9189\u4e86\u9189\u4e86...." }, { "author": { "url": "member/wingyiu", "name": "wingyiu", "avatar": "https://cdn.v2ex.com/avatar/691e/fa33/46559_large.png?m=1445329049" }, "url": "t/195754", "title": "\u963f\u91cc\u4e91 ECS 1CPU 1G 1Mbs \u8dd1 tornado \u5f00\u591a\u5c11\u8fdb\u7a0b\u5408\u9002\uff1f", "id": "t/195754", "date_published": "2015-06-03T04:00:12+00:00", "content_html": "\u5982\u9898,nginx+3tornado\u53ea\u8dd1\u4e8630RPS\uff0c\u600e\u4e48\u7834\uff1f\u6b63\u5e38\u4e0d\uff1f" }, { "author": { "url": "member/tornadoxyz", "name": "tornadoxyz", "avatar": "https://cdn.v2ex.com/gravatar/30c91d8f7e9b82311fbf305ea4983128?s=73&d=retro" }, "url": "t/192095", "title": "tornado.locale.format_date()\u7684\u65e5\u671f\u6c49\u5316\u95ee\u9898", "id": "t/192095", "date_published": "2015-05-19T01:08:12+00:00", "content_html": "\u5728Introduction to tornado\u4e00\u4e66\u4e2d\uff0c\u4f7f\u7528\r
```\r
{{ locale.format_date() }} \r
```\r
\u51fd\u6570\u5bf9\u65f6\u95f4\u6233\u8fdb\u884c\u8f6c\u5316\uff0c\u53ef\u662f\u8f6c\u6362\u540e\u7684\u7ed3\u679c\u4e3a\u82f1\u6587\u7684\uff0c\u4f8b\u5982 2 seconds ago\uff0c\u6709\u6ca1\u6709\u65b9\u6cd5\u5c06\u5176\u6c49\u5316\u4e3a\u4e2d\u6587\u5462\uff1f\u7c97\u7565\u7684\u770b\u8fc7tornado.locale\u6a21\u5757\u7684\u6e90\u7801\uff0c\u53ef\u8fd8\u662f\u4e00\u5934\u96fe\u6c34\u3002\u671b\u5404\u4f4d\u670b\u53cb\u4e0d\u541d\u8d50\u6559\u3002" }, { "author": { "url": "member/waynee", "name": "waynee", "avatar": "https://cdn.v2ex.com/avatar/5dd3/b684/38050_large.png?m=1426133920" }, "url": "t/190156", "date_modified": "2022-03-21T05:16:23+00:00", "content_html": "\u6700\u8fd1\u5728\u5b66\u4e60Tornado\uff0c\u5728\u5199\u5206\u9875\u7684\u65f6\u5019\u9047\u5230\u4e86\u74f6\u9888\u3002\r
\u662f\u53c2\u7167\u8fd9\u4e2a\u95ee\u7b54\u8fdb\u884c\u5199\u7684\uff1a\r
http://stackoverflow.com/questions/15981257/can-tornado-handle-pagination\r
\r
\u8def\u5f84\u5c31\u662f\uff1a(r"/",MainHandler)\r
\r
\u903b\u8f91\u662f\uff1a\r
class MainHandler(BaseHandler):\r
def get(self,template_variables = {}):\r
news_timeline = self.news_model.get_all_news() \uff03\u83b7\u53d6\u6240\u6709news\r
current_page = int(self.get_argument('page',0)) \uff03 \u83b7\u53d6\u5f53\u524dURL\u91cc\u7684page\u53c2\u6570\r
template_variables["news_timeline"] = news_timeline\r
template_variables["current_page"] = current_page\r
self.render("index.html",**template_variables)\r
\r
HTMl\u662f\uff1a\r
<body>\r
{% for news in news_timeline %}\r
<a href = "{{ news["news_link"] }}">{{ news["news_name"] }}</a>\r
{% end %}\r
{% module Paginator(current_page,5, len(news_timeline)) %}\r
</body>\r
\r
\u4f46\u662f\u5e95\u90e8\u7684\u5206\u9875\u94fe\u63a5\u80fd\u591f\u663e\u793a\u51fa\u6765\uff0c\u53ef\u662f\u6240\u6709\u7ed3\u679c\u90fd\u663e\u793a\u5728\u4e86\u4e00\u4e2a\u9875\u9762\uff0c\u5e76\u6ca1\u6709\u5206\u5f00\u663e\u793a\u3002\u73b0\u5728\u627e\u4e0d\u5230\u95ee\u9898\u5728\u54ea\u91cc\uff0c\u662f\u6211\u5c11\u4e9b\u4e86\u4ec0\u4e48\u4ee3\u7801\u5417\uff1f\r
\r
\u5404\u4f4d\u5927\u795e\uff0c\u6c42\u6559\uff01\uff01\uff01", "date_published": "2015-05-11T06:12:52+00:00", "title": "Tornado \u5206\u9875\u95ee\u9898\u6c42\u89e3\uff01", "id": "t/190156" }, { "author": { "url": "member/Emory_M", "name": "Emory_M", "avatar": "https://cdn.v2ex.com/avatar/310d/cbbf/333_large.png?m=1611546038" }, "url": "t/183039", "title": "Tornado \u5f00\u53d1\u4e2d\u51fa\u9519\u8c03\u8bd5\u5982\u4f55\u50cf PHP \u4e00\u6837\uff1f", "id": "t/183039", "date_published": "2015-04-11T05:45:36+00:00", "content_html": "php\u5f00\u53d1\u7684\u65f6\u5019\u56e0\u4e3aCGI\u7ba1\u7406\u548cphp\u89e3\u91ca\u5668\u662f\u72ec\u7acb\u7684\uff0c\u6240\u4ee5HTTP\u670d\u52a1\u4e0d\u4f1a\u56e0\u4e3a\u9519\u8bef\u800c\u6302\u6389\uff0c\u53ea\u8981\u4fee\u6539\u597d\u4ee3\u7801\u5237\u65b0\u9875\u9762\u5c31\u884c

\u4f46\u662fTornado\u6216Python Web\u5f00\u53d1\u4e2d\u5982\u679c\u9047\u5230\u9519\u8bef\u8fdb\u7a0b\u9000\u51fa\uff0c\u90fd\u9700\u8981\u4fee\u6539\u4ee3\u7801\u540e\u624b\u52a8\u91cd\u542f\u8fdb\u7a0b\uff0c\u4f53\u9a8c\u975e\u5e38\u4e0d\u597d

Node.js\u53ef\u4ee5\u4f7f\u7528cluster\u6765\u542f\u52a8\u5b50\u8fdb\u7a0b\u7ba1\u7406\uff0c \u5b9e\u73b0\u201c\u51fa\u9519-\u76d1\u63a7\u4ee3\u7801\u4fee\u6539-\u91cd\u542f\u8fdb\u7a0b\u201d
\u6bd4\u5982\uff1a https://github.com/DoubleSpout/ClusterPlus

Tornado\u7684tornado.autoreload\u6a21\u5757\u4f3c\u4e4e\u53ea\u80fd\u5904\u7406import-time\u53d1\u751f\u7684\u8bed\u6cd5\u9519\u8bef\uff0c\u5e76\u4e0d\u80fd\u6301\u7eed\u8fdb\u5165wait\u76d1\u63a7

\u8bf7\u6559\u4e00\u4e0bTornado\u4e0b\u7684\u89e3\u51b3\u601d\u8def" }, { "author": { "url": "member/guoran728", "name": "guoran728", "avatar": "https://cdn.v2ex.com/gravatar/00fbc3492e0aaea7ca35ab29f3279fde?s=73&d=retro" }, "url": "t/182595", "date_modified": "2015-04-09T08:01:28+00:00", "content_html": "

\u5b98\u65b9\u4f8b\u5b50:

\n\n

from tornado.concurrent import Future

\n\n

def async_fetch_future(url):
\n http_client = AsyncHTTPClient()
\n my_future = Future()
\n fetch_future = http_client.fetch(url)
\n fetch_future.add_done_callback(
\n lambda f: my_future.set_result(f.result()))
\n return my_future
\n\u4ec0\u4e48\u534f\u7a0b,\u5f02\u6b65\u8ff7\u8ff7\u7cca\u7cca\u7684!

\n\n

\u5b8c\u5168\u4e0d\u61c2 my_future = Future() \u4e3a\u4ec0\u4e48\u8981\u751f\u6210\u4e2a Future \u5bf9\u8c61,\u6700\u540e\u53c8\u8fd4\u56de\u5b83\uff01\uff01\u5df2\u7ecf\u75db\u82e6\u4e86\u51e0\u5929\u4e86\uff01\uff01\u5927\u795e\u6765\u89e3\u6551\u4e0b\u6211\u5427

\n", "date_published": "2015-04-09T07:33:06+00:00", "title": "\u65b0\u624b\u5b8c\u5168\u4e0d\u61c2 tornado.concurrent.Future", "id": "t/182595" }, { "author": { "url": "member/waynee", "name": "waynee", "avatar": "https://cdn.v2ex.com/avatar/5dd3/b684/38050_large.png?m=1426133920" }, "url": "t/182359", "date_modified": "2015-04-08T19:41:36+00:00", "content_html": "RT\uff0c\u505a\u4e00\u4e2a\u8c03\u67e5\u3002
http://learntornado.launchrock.com/", "date_published": "2015-04-08T08:52:02+00:00", "title": "\u6709\u591a\u5c11\u4eba \u6709\u4ed8\u8d39\u5b66\u4e60 Tornado \u7684\u610f\u613f\uff0c\u8fd9\u662f\u4e00\u4e2a\u5b66\u4e60\u7f51\u7ad9\u3002", "id": "t/182359" }, { "author": { "url": "member/waynee", "name": "waynee", "avatar": "https://cdn.v2ex.com/avatar/5dd3/b684/38050_large.png?m=1426133920" }, "url": "t/176237", "title": "\u8bf7\u95ee\u4e0b tornado \u5728 ios app \u540e\u53f0\u65b9\u9762\u6709\u6210\u719f\u7684\u5b9e\u73b0\u5417\uff1f", "id": "t/176237", "date_published": "2015-03-11T16:48:13+00:00", "content_html": "" }, { "author": { "url": "member/invite", "name": "invite", "avatar": "https://cdn.v2ex.com/gravatar/6f923c92f2bf3bbafc1730dc412016e3?s=73&d=retro" }, "url": "t/172965", "title": "\u65b0\u624b\u6c42\u6559\u5173\u4e8e Tornado + SQLite \u7684\u4e24\u4e2a\u95ee\u9898", "id": "t/172965", "date_published": "2015-02-26T08:22:28+00:00", "content_html": "

\u76ee\u524d\u7684\u60c5\u51b5\u662f\uff0c\u4e00\u4e2a Tornado \u8fdb\u7a0b\uff0c \u7136\u540e\u6309\u6211\u7684\u7406\u89e3\uff0c\u8bf7\u6c42\u6765\u4e86\u4ee5\u540e\uff0c\u4f1a\u81ea\u5df1\u5f00\u7ebf\u7a0b\u5904\u7406\u7684\u3002 \u90a3\u4e48\u95ee\u9898\u6765\u4e86\uff1a

\n\n

1\u3001\u591a\u4e2a\u8fdb\u7a0b\u540c\u65f6\u8bfb\u53d6SQLite\uff0c\u4f1a\u6709\u9501\u5b9a\u4e48\uff1f \u7f51\u4e0a\u8bf4\u591a\u4e2a\u8fdb\u7a0b\u53ef\u4ee5\u540c\u65f6\u8bfb\u5199\uff0c\u4f46\u8bf4\u5199\u7684\u65f6\u5019\u6709\u9501\u5b9a\uff0c\u90a3\u8bfb\u7684\u65f6\u5019\uff0c\u662f\u4e0d\u662f\u90fd\u80fd\u7acb\u9a6c\u8fd4\u56de\uff1f\u5982\u679c\u53ef\u4ee5\u7acb\u9a6c\u8fd4\u56de\uff0c \u90a3\u5e94\u8be5\u53ef\u4ee5\u5f00\u591a\u4e2a Tornado \u4e86\u5427\uff1f

\n\n

2\u3001\u591a\u4e2a\u7ebf\u7a0b\u4e4b\u95f4\uff0c\u4e0d\u80fd\u5171\u4eab\u53e5\u67c4\u4e48\uff1f\u7f51\u4e0a\u8bf4\uff0c\u591a\u7ebf\u7a0b\u4e4b\u95f4\u5171\u4eab\u53e5\u67c4\u53ef\u80fd\u5b58\u5728\u95ee\u9898\uff0c\u90a3\u591a\u7ebf\u7a0b\u67e5\u8be2\u7684\u8bdd\uff0c\u6bcf\u6b21\u8981connect\uff0c\u7136\u540e\u5728close\u4e48\uff1f \u600e\u4e48\u6837\u80fd\u5728 Tornado \u91cc\u4fdd\u6301SQLite\u7684\u957f\u8fde\u63a5\u5462\uff1f

\n\n

\u76ee\u524d\u7684\u9700\u6c42\u662f\uff1a SQLite \u53ea\u8bfb\uff0c\u6ca1\u6709\u5199\u7684\u9700\u6c42\u3002

\n" }, { "author": { "url": "member/Livid", "name": "Livid", "avatar": "https://cdn.v2ex.com/avatar/c4ca/4238/1_large.png?m=1777863673" }, "url": "t/172185", "title": "Tornado 4.1", "id": "t/172185", "date_published": "2015-02-22T10:13:58+00:00", "content_html": "http://www.tornadoweb.org/en/stable/releases/v4.1.0.html" }, { "author": { "url": "member/Livid", "name": "Livid", "avatar": "https://cdn.v2ex.com/avatar/c4ca/4238/1_large.png?m=1777863673" }, "url": "t/171602", "title": "\u5173\u4e8e\u4f18\u96c5\u5730\u90e8\u7f72 Tornado \u65b0\u4ee3\u7801\u7684\u4e00\u79cd\u65b9\u5f0f", "id": "t/171602", "date_published": "2015-02-17T23:28:33+00:00", "content_html": "http://stackoverflow.com/questions/8086885/is-there-a-way-to-deploy-new-code-with-tornado-python-without-restarting-the-ser" }, { "author": { "url": "member/jecvay", "name": "jecvay", "avatar": "https://cdn.v2ex.com/avatar/5d88/04b8/75586_large.png?m=1668072609" }, "url": "t/170521", "title": "Tornado Template \u5982\u4f55\u83b7\u5f97 Javascript \u4e2d\u7684 var \u53d8\u91cf?", "id": "t/170521", "date_published": "2015-02-12T09:11:58+00:00", "content_html": "

\u6211\u60f3\u901a\u8fc7jQuery \u53d1\u8d77\u4e00\u4e2a\u5bf9api\u7684GET\u8bf7\u6c42, \u83b7\u5f97\u4e00\u4e2ajson\u683c\u5f0f\u7684list, \u7136\u540e\u7528 {% for %}\u63a7\u5236\u8bed\u53e5\u6765\u628ajson\u91cc\u9762\u7684\u6bcf\u4e00\u4e2aTitle\u7ed9\u663e\u793a\u51fa\u6765.

\n\n

\u6c42\u6559\u5982\u4f55\u5728 {% %} \u91cc\u9762\u8c03\u7528 jQuery\u83b7\u5f97\u7684data

\n" }, { "author": { "url": "member/pagict", "name": "pagict", "avatar": "https://cdn.v2ex.com/avatar/96a0/cc2f/9380_large.png?m=1572610161" }, "url": "t/164660", "date_modified": "2015-01-22T16:39:42+00:00", "content_html": "\u6700\u8fd1\u5728\u8ddf\u7740 Introduction to Tornado \u5b66Tornado\uff0c\u505a\u5230Chapter5 \u7684 Live Inventory Reporting \u793a\u4f8b\u7684\u65f6\u5019\uff0c\u53d1\u73b0\u6ca1\u6709\u60f3\u8981\u7684\u6548\u679c\u3002
\u5177\u4f53\u5c31\u662f\uff0c\u5e94\u8be5\u70b9\u4e86 Add to cart \u7684button \u540e\u4f1a\u9690\u85cf\uff0c\u6362\u4e3a Remove from cart button, \u53e6\u5916\u5c31\u662f stock left \u6570\u8981\u51cf\u5c11\u5427\uff0c\u4f46\u662f\u73b0\u5728\u5374\u90fd\u6ca1\u53cd\u5e94\u3002\u611f\u89c9\u662fJavascript \u6ca1\u6709\u6b63\u786eload\uff0c\u4f46\u662f\u5c0f\u5f1f\u53c8\u8fd8\u4e0d\u61c2javascipt\u3002\u73b0\u5728\u731c\u60f3\u662f\u4e0d\u662f\u4e66\u4e0a\u4f8b\u5b50\u8fc7\u65f6\u4e86\u7684\u539f\u56e0\uff0c\u6211\u7684\u73af\u5883\u662f\uff1apython 3.4, tornado 4.1.dev1
\u6709\u54ea\u4f4d\u80fd\u5e2e\u5fd9\u770b\u4e0b\u4e48\uff1f\u4ee3\u7801\u5012\u662f\u7167\u7740\u4e66\u4e0a\u6572\u7684

\u76ee\u5f55\u7ed3\u6784\uff1a
Long Polling/
|_shopping_cart.py
|_static/
|_ _|_scripts/
|_ _ _|_inventory.js
|_templates/
|_ _|_index.html", "date_published": "2015-01-22T16:38:25+00:00", "title": "\u5b66\u4e60 \"Introduction to tornado\" \u63d0\u95ee", "id": "t/164660" }, { "author": { "url": "member/jecvay", "name": "jecvay", "avatar": "https://cdn.v2ex.com/avatar/5d88/04b8/75586_large.png?m=1668072609" }, "url": "t/163815", "date_modified": "2015-01-20T05:41:54+00:00", "content_html": "

\u6211\u6ca1\u6709\u5f00\u53d1\u7f51\u7ad9\u7684\u7ecf\u9a8c, \u53ea\u662f\u770b\u8fc7\u4e86Python\u548cTornado\u90a3\u672c100\u591a\u9875\u7684\u5165\u95e8\u4e66.
\n\u73b0\u5728\u6709\u4e2a\u9879\u76ee\u662f\u505a\u4e2a\u7ba1\u7406\u7cfb\u7edf\u7f51\u7ad9, \u6253\u7b97\u7528 Mongodb \u6570\u636e\u5e93.
\n\u800c\u4e14\u6211\u5bf9\u5f02\u6b65\u4ec0\u4e48\u7684\u6ca1\u6709\u4efb\u4f55\u7ecf\u9a8c,

\n\n

\u8bf7\u95ee\u6709\u4ec0\u4e48\u8981\u6ce8\u610f\u7684?

\n", "date_published": "2015-01-20T05:35:00+00:00", "title": "\u7528 Tornado + Mongodb \u5f00\u53d1\u8981\u6ce8\u610f\u4ec0\u4e48?", "id": "t/163815" }, { "author": { "url": "member/Livid", "name": "Livid", "avatar": "https://cdn.v2ex.com/avatar/c4ca/4238/1_large.png?m=1777863673" }, "url": "t/163238", "title": "\u7528 Tornado \u505a\u7684\u7f51\u7ad9\uff0c\u5927\u5bb6\u5728\u5199\u6d4b\u8bd5\u7684\u65f6\u5019\uff0c\u4e00\u822c\u90fd\u662f\u600e\u4e48\u505a\u7684\u5462\uff1f", "id": "t/163238", "date_published": "2015-01-18T09:08:41+00:00", "content_html": "" }, { "author": { "url": "member/mqingyn616", "name": "mqingyn616", "avatar": "https://cdn.v2ex.com/avatar/7ec9/a2d2/91953_large.png?m=1421303756" }, "url": "t/162401", "title": "\u5206\u4eab\u672c\u4eba\u57fa\u4e8e tornado \u5f00\u53d1\u7684\u5e94\u7528\u5c42\u6846\u67b6", "id": "t/162401", "date_published": "2015-01-15T06:31:38+00:00", "content_html": "

https://github.com/mqingyn/torngas

\n\n

Torngas \u662f\u57fa\u4e8eTornado\u7684\u5e94\u7528\u5f00\u53d1\u6846\u67b6\uff0ctornado\u662f\u4e00\u4e2a\u5f02\u6b65\u975e\u963b\u585e\u7684web\u6846\u67b6\uff0c\u4f46\u662f\u7531\u4e8e\u5176\u5c0f\u5de7\u7075\u6d3b\uff0c\u5e76\u6ca1\u6709\u4e00\u4e2a\u7edf\u4e00\uff0c\u901a\u7528\u7684 \u5e94\u7528\u5c42\u6846\u67b6\u89e3\u51b3\u65b9\u6848\u3002Torngas \u5927\u91cf\u53c2\u8003\u548c\u501f\u9274\u4e86Django\u7684\u8bbe\u8ba1\u6a21\u5f0f\uff0c\u5f62\u6210\u4e00\u5957\u57fa\u4e8etornado\u7684Django like\u5e94\u7528\u5c42\u5f00\u53d1\u6846\u67b6\u3002
\n\u8fd9\u4e2a\u6846\u67b6\u5df2\u7ecf\u5e94\u7528\u5728\u5343\u4e07\u7ea7PV\u7684\u9879\u76ee\u91cc\uff0c\u73b0\u5728\u5f00\u6e90\u51fa\u6765\uff0c\u5e0c\u671b\u5bf9\u5927\u5bb6\u6709\u7528\u3002^ _^

\n" }, { "author": { "url": "member/jecvay", "name": "jecvay", "avatar": "https://cdn.v2ex.com/avatar/5d88/04b8/75586_large.png?m=1668072609" }, "url": "t/160351", "title": "Nginx \u591a\u7aef\u53e3\u8fd0\u884c Tornado \u5982\u4f55\u83b7\u53d6\u5f53\u524d\u7aef\u53e3", "id": "t/160351", "date_published": "2015-01-08T07:58:39+00:00", "content_html": "

\u914d\u7f6e\u4e86 Nginx \u4f1a\u5c06\u8bf7\u6c42\u5206\u7ed9 8000:8003 \u56db\u4e2a\u7aef\u53e3, \u6211\u60f3Tornado\u5efa\u4e00\u4e2a\u9875\u9762, \u8bbf\u95ee\u8fd9\u4e2a\u9875\u9762\u7684\u65f6\u5019\u6d4f\u89c8\u5668\u4e0a\u80fd\u663e\u793a\u51fa\u8fd9\u4e2a\u9875\u9762\u7684\u8bf7\u6c42\u7531\u54ea\u4e00\u4e2a\u7aef\u53e3\u83b7\u53d6\u4e86, \u5982\u4f55\u80fd\u5b9e\u73b0\u8fd9\u4e2a\u529f\u80fd?

\n\n

RequestHandler \u8c8c\u4f3c\u6ca1\u6709\u4f20\u8fdb\u6765\u7aef\u53e3\u53f7?

\n" }, { "author": { "url": "member/blueandhack", "name": "blueandhack", "avatar": "https://cdn.v2ex.com/avatar/c03d/ada7/34443_large.png?m=1707800861" }, "url": "t/156122", "title": "Tornado \u6846\u67b6\u5982\u4f55\u5199 MVC \u6a21\u5f0f\uff1f", "id": "t/156122", "date_published": "2014-12-23T13:06:49+00:00", "content_html": "\u4e4b\u524d\u5199\u8fc7Nodejs\uff0c\u4e0d\u77e5\u9053Tornado\u5982\u4f55\u6765\u5199\uff0c\u6709\u53ef\u4ee5\u53c2\u8003\u7684\u4f8b\u5b50\u5417\uff1f
\u4e4b\u524d\u641c\u8fc7\uff0c\u6ca1\u627e\u5230\u4e00\u4e2a\u5b8c\u6574\u9879\u76ee\uff0c\u5c31\u63a8\u8350\u3002" } ] } ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86