gunicorn 启动问题 Failed to find application

如题,搜了一下没找到解决方案

阅读 11.3k
3 个回答

如题,应该是你的directory设置错了,command=/usr/bin/gunicorn app:applicationapp是一个文件名,application是该文件中程序启动的一个对象,也有可能是这个设置没有对应上。你应该贴一下你的gunicorn代码出来的。

如果你用虚拟环境的gunicorn的话,应该在command中给出全路径,同时也提供python的路径,如:

command=/my/path/to/venv/bin/python /my/path/to/venv/bin/gunicorn application:app,application

是入口文件,app是里面入口函数,如通过app.run()执行。如果楼主还没有解决,建议把gunicorn配置文件和环境贴出来,这样更好分析。

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题