在heroku上部署django网站时出错

在heroku上部署django网站时出错,django,heroku,heroku-postgres,Django,Heroku,Heroku Postgres,我正在heroku中部署django网站,数据库={}位于django的setting.py文件中。 我正在遵循的所有步骤和运行的每个命令 但运行命令时出现了一些应用程序错误- 赫罗库公开赛 (jango)dc@dc-comp-4:~/website$ heroku open Opening evening-waters-7886... done (jango)dc@dc-comp-4:~/website$ (process:8176): GLib-CRITICAL

我正在heroku中部署django网站,数据库={}位于django的setting.py文件中。 我正在遵循的所有步骤和运行的每个命令 但运行命令时出现了一些应用程序错误-

赫罗库公开赛

 (jango)dc@dc-comp-4:~/website$ heroku open
    Opening evening-waters-7886... done
    (jango)dc@dc-comp-4:~/website$ 
    (process:8176): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed
我的heroku日志状态是-

dc@dc-comp-4:~/website$ heroku logs
2015-02-26T09:07:09.555685+00:00 heroku[web.1]: State changed from crashed to starting
2015-02-26T09:07:09.555087+00:00 heroku[web.1]: State changed from starting to crashed
2015-02-26T09:07:17.890143+00:00 heroku[web.1]: Starting process with command `gunicorn gettingstarted.wsgi --log-file -`
2015-02-26T09:07:20.325197+00:00 app[web.1]: bash: gunicorn: command not found
2015-02-26T09:07:21.184736+00:00 heroku[web.1]: Process exited with status 127
2015-02-26T09:07:21.202490+00:00 heroku[web.1]: State changed from starting to crashed
2015-02-26T09:07:27.250898+00:00 heroku[api]: Scale to web=1 by rahulsatal92@gmail.com
2015-02-26T09:07:56.156898+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=evening-waters-7886.herokuapp.com request_id=9a9781c5-57d6-43c2-8ca0-43df571804a0 fwd="14.139.240.226" dyno= connect= service= status=503 bytes=
2015-02-26T09:08:01.602067+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=evening-waters-7886.herokuapp.com request_id=597a1c36-200e-4f8c-8dfe-b00d4d2cacee fwd="14.139.240.226" dyno= connect= service= status=503 bytes=
2015-02-26T09:08:03.737046+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=evening-waters-7886.herokuapp.com request_id=4d790108-6019-4fce-9d1e-10eafca9efc1 fwd="14.139.240.226" dyno= connect= service= status=503 bytes=
2015-02-26T09:27:54.099907+00:00 heroku[api]: Deploy e061461 by rahulsatal92@gmail.com
2015-02-26T09:27:54.099907+00:00 heroku[api]: Release v6 created by rahulsatal92@gmail.com
2015-02-26T09:27:54.255144+00:00 heroku[web.1]: State changed from crashed to starting
2015-02-26T09:28:05.720678+00:00 heroku[web.1]: Starting process with command `gunicorn website:app --log-file=-`
2015-02-26T09:28:06.984648+00:00 app[web.1]: bash: gunicorn: command not found
2015-02-26T09:28:07.736542+00:00 heroku[web.1]: State changed from starting to crashed
2015-02-26T09:28:07.737796+00:00 heroku[web.1]: State changed from crashed to starting
2015-02-26T09:28:07.721050+00:00 heroku[web.1]: Process exited with status 127
2015-02-26T09:28:11.784672+00:00 heroku[web.1]: Starting process with command `gunicorn website:app --log-file=-`
2015-02-26T09:28:13.765503+00:00 app[web.1]: bash: gunicorn: command not found
2015-02-26T09:28:14.689070+00:00 heroku[web.1]: Process exited with status 127
2015-02-26T09:28:14.702968+00:00 heroku[web.1]: State changed from starting to crashed
2015-02-26T09:28:18.234685+00:00 heroku[api]: Scale to web=1 by rahulsatal92@gmail.com
2015-02-26T09:28:48.532426+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=evening-waters-7886.herokuapp.com request_id=a2b76940-91ea-4d2d-884e-0049bc707217 fwd="14.139.240.226" dyno= connect= service= status=503 bytes=
2015-02-26T09:32:01.295019+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=evening-waters-7886.herokuapp.com request_id=7bf7ddc0-a04f-4f40-aade-f7a5116cf9f0 fwd="14.139.240.226" dyno= connect= service= status=503 bytes=
2015-02-26T09:34:29.437580+00:00 heroku[api]: Attach HEROKU_POSTGRESQL_BLUE resource by rahulsatal92@gmail.com
2015-02-26T09:34:29.437580+00:00 heroku[api]: Release v7 created by rahulsatal92@gmail.com
2015-02-26T09:34:29.678932+00:00 heroku[web.1]: State changed from crashed to starting
2015-02-26T09:34:33.288768+00:00 heroku[web.1]: Starting process with command `gunicorn website:app --log-file=-`
2015-02-26T09:34:35.045626+00:00 app[web.1]: bash: gunicorn: command not found
2015-02-26T09:34:35.717937+00:00 heroku[web.1]: Process exited with status 127
2015-02-26T09:34:35.729414+00:00 heroku[web.1]: State changed from starting to crashed
2015-02-26T09:39:47.384245+00:00 heroku[api]: Release v8 created by rahulsatal92@gmail.com
2015-02-26T09:39:47.384245+00:00 heroku[api]: Attach HEROKU_POSTGRESQL_OLIVE resource by rahulsatal92@gmail.com
2015-02-26T09:39:47.747151+00:00 heroku[web.1]: State changed from crashed to starting
2015-02-26T09:39:50.940581+00:00 heroku[web.1]: Starting process with command `gunicorn website:app --log-file=-`
2015-02-26T09:39:52.075160+00:00 app[web.1]: bash: gunicorn: command not found
2015-02-26T09:39:52.716034+00:00 heroku[web.1]: State changed from starting to crashed
2015-02-26T09:39:52.716772+00:00 heroku[web.1]: State changed from crashed to starting
2015-02-26T09:39:52.705237+00:00 heroku[web.1]: Process exited with status 127
2015-02-26T09:39:56.910325+00:00 heroku[web.1]: Starting process with command `gunicorn website:app --log-file=-`
2015-02-26T09:39:58.335235+00:00 app[web.1]: bash: gunicorn: command not found
2015-02-26T09:39:59.091134+00:00 heroku[web.1]: Process exited with status 127
2015-02-26T09:39:59.123230+00:00 heroku[web.1]: State changed from starting to crashed
2015-02-26T09:41:28.032235+00:00 heroku[api]: Deploy 5e882c5 by rahulsatal92@gmail.com
2015-02-26T09:41:28.032235+00:00 heroku[api]: Release v9 created by rahulsatal92@gmail.com
2015-02-26T09:41:28.577676+00:00 heroku[web.1]: State changed from crashed to starting
2015-02-26T09:41:32.256825+00:00 heroku[web.1]: Starting process with command `gunicorn website:app --log-file=-`
2015-02-26T09:41:33.437334+00:00 app[web.1]: bash: gunicorn: command not found
2015-02-26T09:41:34.121450+00:00 heroku[web.1]: Process exited with status 127
2015-02-26T09:41:34.126557+00:00 heroku[web.1]: State changed from starting to crashed
2015-02-26T09:41:46.438295+00:00 heroku[api]: Scale to web=1 by rahulsatal92@gmail.com
2015-02-26T09:42:04.929728+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=evening-waters-7886.herokuapp.com request_id=f16cebee-7c15-42d5-bba6-a4c85d0addaf fwd="14.139.240.226" dyno= connect= service= status=503 bytes=
2015-02-26T09:43:05.406941+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=evening-waters-7886.herokuapp.com request_id=9e4aa61d-073d-49d2-a696-606b4c965d51 fwd="14.139.240.226" dyno= connect= service= status=503 bytes=
2015-02-26T09:44:05.946147+00:00 heroku[api]: Attach HEROKU_POSTGRESQL_COPPER resource by rahulsatal92@gmail.com
2015-02-26T09:44:05.946147+00:00 heroku[api]: Release v10 created by rahulsatal92@gmail.com
2015-02-26T09:44:06.133499+00:00 heroku[web.1]: State changed from crashed to starting
2015-02-26T09:44:09.806610+00:00 heroku[web.1]: Starting process with command `gunicorn website:app --log-file=-`
2015-02-26T09:44:11.203036+00:00 app[web.1]: bash: gunicorn: command not found
2015-02-26T09:44:11.895235+00:00 heroku[web.1]: Process exited with status 127
2015-02-26T09:44:11.911573+00:00 heroku[web.1]: State changed from starting to crashed
2015-02-26T09:52:08.400443+00:00 heroku[api]: Scale to web=1 by rahulsatal92@gmail.com
2015-02-26T09:52:30.139203+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=evening-waters-7886.herokuapp.com request_id=2e818d74-a717-41d4-9050-3be25889eaed fwd="14.139.240.226" dyno= connect= service= status=503 bytes=
2015-02-26T09:58:07.383685+00:00 heroku[api]: Starting process with command `rake db:migrate` by rahulsatal92@gmail.com
2015-02-26T09:58:11.492711+00:00 heroku[run.3731]: Awaiting client
2015-02-26T09:58:11.520152+00:00 heroku[run.3731]: Starting process with command `rake db:migrate`
2015-02-26T09:58:13.489900+00:00 heroku[run.3731]: Process exited with status 127
2015-02-26T09:58:13.503789+00:00 heroku[run.3731]: State changed from up to complete
2015-02-26T09:58:11.931301+00:00 heroku[run.3731]: State changed from starting to up
2015-02-26T09:59:05.424832+00:00 heroku[web.1]: State changed from crashed to starting
2015-02-26T09:59:12.340999+00:00 heroku[web.1]: Starting process with command `gunicorn website:app --log-file=-`
2015-02-26T09:59:13.778095+00:00 app[web.1]: bash: gunicorn: command not found
2015-02-26T09:59:14.428734+00:00 heroku[web.1]: Process exited with status 127
2015-02-26T09:59:14.437924+00:00 heroku[web.1]: State changed from starting to crashed
2015-02-26T09:59:14.438617+00:00 heroku[web.1]: State changed from crashed to starting
2015-02-26T09:59:17.805847+00:00 heroku[web.1]: Starting process with command `gunicorn website:app --log-file=-`
2015-02-26T09:59:19.331755+00:00 app[web.1]: bash: gunicorn: command not found
2015-02-26T09:59:20.010738+00:00 heroku[web.1]: Process exited with status 127
2015-02-26T09:59:20.028996+00:00 heroku[web.1]: State changed from starting to crashed
2015-02-26T09:59:23.726010+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=evening-waters-7886.herokuapp.com request_id=c2ba4a6d-1357-47a4-abee-78cfe3db7545 fwd="14.139.240.226" dyno= connect= service= status=503 bytes=
2015-02-26T10:04:06.912448+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=evening-waters-7886.herokuapp.com request_id=5d21087f-d811-4685-964b-23acf24fd499 fwd="14.139.240.226" dyno= connect= service= status=503 bytes=
2015-02-26T10:29:10.000446+00:00 heroku[api]: Starting process with command `pip install gunicorn` by rahulsatal92@gmail.com
2015-02-26T10:29:13.833066+00:00 heroku[run.8299]: Awaiting client
2015-02-26T10:29:13.871544+00:00 heroku[run.8299]: Starting process with command `pip install gunicorn`
2015-02-26T10:29:14.121060+00:00 heroku[run.8299]: State changed from starting to up
2015-02-26T10:29:18.182526+00:00 heroku[run.8299]: Process exited with status 0
2015-02-26T10:29:18.195891+00:00 heroku[run.8299]: State changed from up to complete
2015-02-26T10:32:34.286827+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=evening-waters-7886.herokuapp.com request_id=29508561-6c27-4ac6-a67d-7543fb87b385 fwd="14.139.240.226" dyno= connect= service= status=503 bytes=
2015-02-26T10:36:58.977614+00:00 heroku[web.1]: State changed from crashed to starting
2015-02-26T10:37:02.450833+00:00 heroku[web.1]: Starting process with command `gunicorn website:app --log-file=-`
2015-02-26T10:37:03.717531+00:00 app[web.1]: bash: gunicorn: command not found
2015-02-26T10:37:04.438957+00:00 heroku[web.1]: State changed from starting to crashed
2015-02-26T10:37:04.439393+00:00 heroku[web.1]: State changed from crashed to starting
2015-02-26T10:37:04.418361+00:00 heroku[web.1]: Process exited with status 127
2015-02-26T10:37:08.015347+00:00 heroku[web.1]: Starting process with command `gunicorn website:app --log-file=-`
2015-02-26T10:37:09.728762+00:00 app[web.1]: bash: gunicorn: command not found
2015-02-26T10:37:10.601803+00:00 heroku[web.1]: State changed from starting to crashed
2015-02-26T10:37:10.596391+00:00 heroku[web.1]: Process exited with status 127
2015-02-26T11:21:32.653989+00:00 heroku[web.1]: State changed from crashed to starting
2015-02-26T11:21:36.340593+00:00 heroku[web.1]: Starting process with command `gunicorn website:app --log-file=-`
2015-02-26T11:23:39.380466+00:00 heroku[web.1]: State changed from starting to down
dc@dc-comp-4:~/website$ ^C
请帮帮我

bash:gunicorn:未找到命令

上述错误清楚地表明,Heroku服务器上没有
gunicorn

如何安装

  • 使用
    pip安装gunicorn安装它将清除错误
  • 将gunicorn添加到requirements.txt文件中

  • 您应该安装django toolbelt(您可以通过
    pip install django toolbelt
    )来完成,它将安装gunicorn),然后您需要将其添加到requirements.txt中(使用
    pip freeze>requirements.txt

    让我这样解释。 Heroku查看您的文件结构并搜索两个内容: Procfile和requirements.txt(如果您有一个python项目,如果您有其他项目,那么表示项目依赖关系的这个文件的名称可能有另一个名称,但让我们继续使用python django)

    它使用requirements.txt的内容来查看它需要安装什么,如果我想要某个库,它需要在requirements.txt中pe(heroku将安装它知道应该安装的所有内容,并且通过查看requirements.txt知道应该安装什么)

    然后查看Procfile(该文件告诉它启动项目应该运行什么)

    现在谈到你的bug,你可以在prof文件中写下流动的东西
    web:python manage.py运行服务器0.0.0.0:$PORT

    这意味着:启动web dyno,运行以下命令并使用环境变量
    $port
    这将使用测试服务器在本地主机上启动django,以确保其正常工作。您不应该在生产中使用它,但对于调试来说是很好的

    如果你不能让它工作,这意味着你有其他问题,不仅仅是枪角失踪

    在heroku教程中有一部分说:

    接下来,使用pip安装应用程序的依赖项。在这种情况下,我们将安装django toolbelt,其中包括我们需要的所有软件包: Django(web框架) Gunicorn(WSGI服务器) dj数据库url(Django配置助手) dj static(一个Django静态文件服务器)

    将您的requirements.txt粘贴到此处,以便我们可以更快地找到它


    对于在heroku上使用Django,请使用。

    在运行上述命令时,我得到-已满足要求(使用-升级到升级):gunicorn in/home/dc/.virtualenvs/jango/lib/python2.7/site-packages Cleaning up…@rahussatal更好的调试方法,您能否登录heroku bash并运行
    pip freeze
    ,以确保
    gunicorn
    ?或者尝试
    heroku run pip install gunicorn
    yes它包含gunicorn==17.5并且命令-heroku run pip install gunicorn成功installed@RahulSatal不,先生,你能再次粘贴heroku日志吗?我已经在问题中更新了我的heroku日志。请检查一下,这是唯一适合我的解决方案。非常感谢您如此详细的回复。