2014-11-26 8 views
1

나는 토네이도장고 : '모듈'개체가 어떤 속성 'WSGI'

wsgi_app = tornado.wsgi.WSGIContainer(
    django.core.wsgi.WSGIHandler() 
) 
tornado_app = tornado.web.Application(
    [ 
     (r"/hello/(.*)", HelloHandler), 
     ('.*', tornado.web.FallbackHandler, dict(fallback=wsgi_app)), 
    ] 
) 
server = tornado.httpserver.HTTPServer(tornado_app) 
server.listen(options.port) 
tornado.ioloop.IOLoop.instance().start() 

폴백 사용 토네이도 서버에 장고 WSGI 응용 프로그램을 실행할하기 위해 노력하고있어하지만이 파일을 실행할 때, 내가있어이 없습니다 다음 오류 :

django.core.wsgi.WSGIHandler() 
AttributeError: 'module' object has no attribute 'wsgi' 

답변

1

수입품을 포함한 전체 코드를 표시하십시오. 방금 import tornado이 아니고 import tornado.wsgi (및 다른 모든 모듈)이 아닌 것 같습니다. 파이썬에서는 필요한 모듈을 모두 가져와야합니다. 한 번에 전체 패키지를 가져올 수 없습니다. (때로는 추이 적 가져 오기로 인해 발생할 수있는 것처럼 보일 수도 있지만, import tornado.httpserver을 입력하면 tornado.ioloop 패키지도로드됩니다)

관련 문제