我将我的 django web 应用程序部署到 heroku 并收到“应用程序错误”消息

我已成功将我的 Django Web 应用程序部署到 Heroku,但收到了Application Error消息。但是,Web 应用程序在本地服务器中正常运行。


http://img3.mukewang.com/6447919f0001d4a706020401.jpg

这是我的应用程序日志:


2020-08-04T03:32:15.540612+00:00 app[api]: Initial release by user rabby.jim999@gmail.com

2020-08-04T03:32:15.540612+00:00 app[api]: Release v1 created by user rabby.jim999@gmail.com

2020-08-04T03:32:15.857822+00:00 app[api]: Release v2 created by user rabby.jim999@gmail.com

2020-08-04T03:32:15.857822+00:00 app[api]: Enable Logplex by user rabby.jim999@gmail.com

2020-08-04T03:32:46.278800+00:00 app[api]: Set DISABLE_COLLECTSTATIC config vars by user rabby.jim999@gmail.com

2020-08-04T03:32:46.278800+00:00 app[api]: Release v3 created by user rabby.jim999@gmail.com

2020-08-04T03:34:06.000000+00:00 app[api]: Build started by user rabby.jim999@gmail.com

2020-08-04T03:34:47.143606+00:00 app[api]: Attach DATABASE (@ref:postgresql-perpendicular-61467) by user rabby.jim999@gmail.com

2020-08-04T03:34:47.143606+00:00 app[api]: Running release v4 commands by user rabby.jim999@gmail.com

2020-08-04T03:34:47.154813+00:00 app[api]: Release v5 created by user rabby.jim999@gmail.com

2020-08-04T03:34:47.154813+00:00 app[api]: @ref:postgresql-perpendicular-61467 completed provisioning, setting DATABASE_URL. by user rabby.jim999@gmail.com

2020-08-04T03:34:47.474554+00:00 app[api]: Deploy e6fcf034 by user rabby.jim999@gmail.com

2020-08-04T03:34:47.474554+00:00 app[api]: Release v6 created by user rabby.jim999@gmail.com

2020-08-04T03:34:47.495253+00:00 app[api]: Scaled to web@1:Free by user rabby.jim999@gmail.com

2020-08-04T03:34:53.033657+00:00 heroku[web.1]: Starting process with command `gunicorn newspaper_project.wsgi --log-file -`

2020-08-04T03:34:55.434601+00:00 app[web.1]: bash: gunicorn: command not found

2020-08-04T03:34:55.495150+00:00 heroku[web.1]: Process exited with status 127

2020-08-04T03:34:55.534079+00:00 heroku[web.1]: State changed from starting to crashed

2020-08-04T03:34:55.536481+00:00 heroku[web.1]: State changed from crashed to starting



大话西游666
浏览 76回答 1
1回答

森林海

您将依赖项放在错误的位置。它们属于[packages]您的部分Pipfile,而不是[requires]部分。通常,您应该很少需要手动编辑您的文件Pipfile,并且您永远不应该手动修改您的Pipfile.lock. 不要向您添加东西Pipfile,而是使用 来安装它们pipenv,例如通过运行pipenv install gunicornPipenv 会自动为你更新你的Pipfile和Pipfile.lock。我建议您执行以下操作:Pipfile.lock本地删除通过运行删除旧的 virtualenvpipenv --rm移动除了python_version = "3.7"从[requires]到[packages]考虑更改所有版本,"*"以便 Pipenv 可以免费更新版本跑步pipenv installpipenv run如果您使用或从运行它,请确保应用程序在本地工作pipenv shellPipfile.lock提交Pipenv 生成的新内容部署展望未来,我强烈建议您通过运行pipenv install而不是Pipfile手动修改或使用pip. 这样做的另一个好处是确保您的本地版本与 Heroku 上使用的版本相匹配。runtime.txt哦,如果您使用的是 Pipenv,则不需要。所需的 Python 版本已在您的Pipfile.
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Python