2016-06-07 2 views
2

내 머리카락을 꺼내십시오! 나는 AWS 탄성 콩 줄기에 파이썬 플라스크 응용 프로그램을 배포하려면 노력하고 있어요 나는 오류를 얻고있다대상 WSGI 스크립트 '/opt/python/current/app/application.py'에 WSGI 응용 프로그램 '응용 프로그램'이 없습니다

대상 WSGI 스크립트 '/opt/python/current/app/application.py'WSGI 응용 프로그램 '응용 프로그램'

포함되어 있지 않습니다 내가 AWS에 업로드 할 때 좋은 고급 로컬

#!/usr/bin/env python3 
import connexion 

if __name__ == '__main__': 
    application = connexion.App(__name__, specification_dir='./swagger/') 
    application.add_api('swagger.yaml', arguments={'title': 'This is a basic API fascade to theprotptype development robot. The API front-ends the communication with an MQTT pub/sub topic, which uses the Amazon Web Services IoT service.'}) 
    application.run() 

실행합니다,하지만 :

웹 페이지는 다음과 같이 내 application.py의 내용은 500 서버 오류를

을 반환하지 않습니다. 나는 application.py하는 app.py에서 이름을 변경하고 응용 프로그램 = 응용 프로그램을 변경 =하지만 변화는

어디 application=... 후 라인 if __name__ == '__main__'를 이동하려면 다음 :(

답변

0

시도를 가야할지하지 마십시오있다 더 예를 들어, 시작 프로그램이 수입 대신 간부의 스크립트가 그것. __main__로 정의되지 않습니다 __name__ 경우. 이것은 page를 볼 수 있기 때문이다.

application = connexion.App(__name__, specification_dir='./swagger/') 
application.add_api('swagger.yaml', arguments={'title': 'This is a basic API fascade to theprotptype development robot. The API front-ends the communication with an MQTT pub/sub topic, which uses the Amazon Web Services IoT service.'}) 
if __name__ == '__main__': 
    application.run() 
+0

감사합니다, 앞으로 이동하는, 지금은 것을 전달 '에서 tributeError : 'module'객체에 'default_controller'속성이 없습니다. :) ( – user2997982

+0

로컬 패키지의 버전이 AWS의 버전과 다른 것으로 보입니다. 관련 패키지의 버전 번호를 확인하십시오. – gdlmx

관련 문제