2017-06-15 142 views
0

我是python的新手。我必须从Amazon Cloud运行一个python应用程序。我正在使用CherryPy并通过Beanstalk进行部署。这是我简单的HelloWorld代码在Elastic Beanstalk中使用CherryPy部署python

import cherrypy 

class Hello(object): 
    @cherrypy.expose 
    def index(self): 
     return "Hello world!" 

if __name__ == '__main__': 
    cherrypy.config.update({'server.socket_host': '0.0.0.0', 
          'server.socket_port': 80,}) 
    cherrypy.quickstart(Hello()) 

requirements.txt文件我有CherryPy==10.2.2。不过,我无法在beanstalk URL中看到任何输出。在部署时出现以下错误,

您的WSGIPath引用了一个不存在的文件。

任何人都可以提供任何见解吗?

回答

0

问题在于中的WSGIPath变量软件配置指定application.py作为init文件。上述代码中的Hello类位于名称不同的文件中。

确保初始代码位于名为application.py的文件中或更改配置。

相关问题