【问题标题】:Deploying a python flask web application on Heroku with Windows使用 Windows 在 Heroku 上部署 python 烧瓶 Web 应用程序
【发布时间】:2018-09-03 06:20:55
【问题描述】:

我正在尝试成功地将我制作的烧瓶应用部署到 Heroku。 应用程序已生成,但当我将代码推送到 Heroku 存储库时出现错误。

我的烧瓶应用程序位于名为 server.py 的模块中,变量名为 app。 起初我尝试使用 gunicorn 和写作 网站:gunicorn 服务器:app 并进行部署,但没有启动网络测功机,我收到一条错误消息,指出它是 Procfile 文件。 关于它的红色并看到 Gunicorn 并没有真正在 Windows 上工作,所以我尝试安装 Waitress 并进行部署但没有成功。这次我的简介写成所有这些(尝试了几次):

web: waitress-serve --listen=*:8000 server.wsgi:application

web: 服务员服务 --listen=*:8000 app.wsgi:application 以此类推。

要添加一个网络测功机,我应该对其进行缩放,因为 heroku ps: 表明没有测功机。

当我尝试运行 heroku ps:scale web=1 我得到:

缩放测功机...! ▸ 找不到该进程类型。

我做错了什么?

【问题讨论】:

  • 你解决了吗?

标签: python windows heroku waitress


【解决方案1】:

我遇到了同样的问题。特别是,女服务员在 Windows 本地工作(在 Procfile.windows 文件 web: waitress-serve index:server 中,然后使用 heroku CLI heroku local -f Procfile.windows),但在 Heroku 部署后失败。对我来说,解决方法是使用女服务员进行本地测试(如解释的那样),但使用 gunicorn 进行部署(Procfile 中的web: gunicorn index:server)。让我知道这是否适合您。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-12-23
    • 1970-01-01
    • 1970-01-01
    • 2014-11-26
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多