2017-01-20 6 views
0

私は竜巻Webサーバーを作成しようとしていて、クイックスタートは私に竜巻の標準プロジェクトを作ったが、ドキュメントによればこの構成はブロックされている。 私はnon-blocking pythonを初めて使っています。Openshiftの非ブロッキングトルネードインスタンス?

私はこれがメインのハンドラファイル

#!/usr/bin/env python 
import tornado.web 

class MainHandler(tornado.web.RequestHandler): 
    def get(self): 
      self.render('index.html') 

であり、アプリケーションフォルダは、この

# 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が含まれている私のPAASサーバーのルートフォルダにあるこのWSGIファイル

#!/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() 

を持っています

uses WSGI to deploy the python applications

は、それはあなたが、その後、OpenShift V2(Kubernetes /ドッカーを使用していないV3)の話をしている場合は、完全に

Though i have seen project that seemed to work

答えて

1

を非ブロックするopenshift上のPythonアプリケーションを構成することが可能ですで説明したようにapp.pyファイルを使用する必要があります。

+0

V3は(次世代)Webコンソールですか?私はV2だと思う。 ウェブサーバーをmod-wsgiや他のuWsgiから竜巻に変更できるかどうかは確かではありませんでした。 ありがとう! –