[英]Not able to deploy pyramid application to the heroku running well in local
This is the error I get checking the logs on HEROKU.这是我在 HEROKU 上检查日志时遇到的错误。 The documentation of pyramid says " Create run with the following command. " So I create a file named as run.py and saved below codes.金字塔的文档说“使用以下命令创建运行。 ”所以我创建了一个名为 run.py 的文件并保存在下面的代码中。 I dont know if this is the right way to create a run if not help me with that.如果不能帮助我,我不知道这是否是创建跑步的正确方法。 Here is the line of code in run.py这是 run.py 中的代码行
#!/bin/bash
set -e
python setup.py develop
python runapp.py
Here is the runapp.py这是runapp.py
import os
from paste.deploy import loadapp
from paste import httpserver
if __name__ == "__main__":
port = int(os.environ.get("PORT", 5000))
app = loadapp('config:development.ini', relative_to='.')
httpserver.serve(app, host='0.0.0.0', port=port)
Finally here is the procfile最后这里是procfile
$ echo "web: ./run" > Procfile
The Pyramid Community Cookbook has a deployment recipe for Heroku , assuming that is what you meant by "the documentation of Pyramid" (it's not official documentation, just a collection of recipes from the community). Pyramid Community Cookbook 有Heroku的部署配方,假设这就是您所说的“金字塔文档”(它不是官方文档,只是来自社区的配方的集合)。
In Step 1, make sure that the four files you create are done so locally in the root of your project directory.在第 1 步中,确保您创建的四个文件在项目目录的根目录中本地完成。
requirements.txt
run.py
should be named run
.您命名为run.py
的文件应命名为run
。 Check that the file named Procfile
was created and contains not the command to generate Procfile
, but just the result of the command, specifically:检查名为Procfile
的文件Procfile
已创建并且不包含生成Procfile
的命令,而仅包含命令的结果,特别是:
web: ./run
runapp.py
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.