如何解决无法使用Gunicorn运行Python瓶子应用
我刚开始使用Bottle。我在GitHub上找到了一个示例应用程序。该示例只有一个server.py文件,如下所示
import bottle
APP = bottle.Bottle()
@APP.get('/')
def index():
return '<p>Hello</p>'
if __name__ == '__main__':
bottle.run(application=APP)
Requirements.txt文件具有
bottle
gunicorn
作为依赖项。我正在使用Python 3.7.2。运行pip install -r requirements.txt后,我运行了python server.py。服务器启动时在端口8080上没有错误
我尝试如下使用gunicorn运行服务器
gunicorn -w 2 -b 0.0.0.0:8080 server:app
这将导致错误,并且服务器无法启动。 gunicorn命令有什么问题?
解决方法
gunicorn -w 2 -b 0.0.0.0:8080服务器:APP
感谢克劳斯D指出
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。