【发布时间】:2017-01-20 03:27:28
【问题描述】:
我正在尝试创建 Tornado 网络服务器,并且快速启动使我成为了 Tornado 的标准项目,但根据文档,此配置被阻止。 我是非阻塞 python 的新手。
我有这个 wsgi 文件,它位于我的 PAAS 服务器的根文件夹中
#!/usr/bin/env python
import os
import imp
import sys
#
# Below for testing only
#
if __name__ == '__main__':
ip = 'localhost'
port = 8051
zapp = imp.load_source('application', 'wsgi/application')
from wsgiref.simple_server import make_server
httpd = make_server(ip, port, zapp.application)
httpd.serve_forever()
这是主处理程序文件
#!/usr/bin/env python
import tornado.web
class MainHandler(tornado.web.RequestHandler):
def get(self):
self.render('index.html')
Application 文件夹包含这个
# Put here yours handlers.
import tornado.wsgi
from . import handlers
handlers = [(r'/',MainHandler),]
application = tornado.wsgi.WSGIApplication(handlers, **settings)
In WSGI mode asynchronous methods are not supported
uses WSGI to deploy the python applications
是否可以在 openshift 上将 python 应用程序配置为完全非阻塞
【问题讨论】:
标签: python tornado openshift-origin