我正在尝试将 python 应用程序部署到 heroku。我使用一个名为 quart 的 Web 框架(Flask 的异步版本)。当我尝试部署时构建成功,但在 heroku 日志中,我收到以下错误消息:
TypeError: __call__() takes 1 positional argument but 3 were
这是运行应用程序的代码:
if __name__ == '__main__':
app.run(host='0.0.0.0', port=int(os.environ['PORT']))
我的 procfile 包含以下内容:
web: gunicorn main_loop:app
如果有帮助,我们将不胜感激。
最佳答案
Quart 需要特定的 Gunicorn worker 类(Class) 1 。我想如果你的 procfile 是
web: gunicorn --worker-class quart.worker.GunicornWorker main_loop:app
它会起作用的。 (不过我没有可用的 heroku dyno 来测试)。
(我是Quart作者)
关于尝试在heroku上运行时出现Python错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50263558/