【发布时间】:2021-12-14 13:57:15
【问题描述】:
我终于让我的 Heroku 应用程序至少在本地工作了!但是,当我尝试在线打开它时,它会崩溃并出现以下错误:
> 2021-10-29T13:16:54.435118+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of
> launch
> 2021-10-29T13:16:56.287092+00:00 heroku[web.1]: Stopping process with SIGKILL
> 2021-10-29T13:16:56.458881+00:00 heroku[web.1]: Process exited with status 137
> 2021-10-29T13:16:56.499621+00:00 heroku[web.1]: State changed from starting to crashed
> 2021-10-29T13:17:13.107001+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/"
> host=shrouded-bastion-04661.herokuapp.com
> request_id=81455b66-dab8-4b20-9c69-91b73739a09a fwd="71.231.14.146"
> dyno= connect= service= status=503 bytes= protocol=https
> 2021-10-29T13:17:13.558163+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico"
> host=shrouded-bastion-04661.herokuapp.com
> request_id=c6b25451-528e-4bed-a415-f35b0bcb739f fwd="71.231.14.146"
> dyno= connect= service= status=503 bytes= protocol=https
我不确定该怎么做,但是当我在本地运行应用程序时,它说:
2021-10-29T13:15:49.232426+00:00 heroku[web.1]: State changed from crashed to starting
2021-10-29T13:15:54.128556+00:00 heroku[web.1]: Starting process with command `python manage.py runserver 0.0.0.0:5000`
2021-10-29T13:15:55.975995+00:00 app[web.1]: Watching for file changes with StatReloader
2021-10-29T13:15:55.976241+00:00 app[web.1]: Performing system checks...
2021-10-29T13:15:55.976241+00:00 app[web.1]:
2021-10-29T13:15:56.168039+00:00 app[web.1]: System check identified no issues (0 silenced).
2021-10-29T13:15:56.434599+00:00 app[web.1]:
2021-10-29T13:15:56.434616+00:00 app[web.1]: You have 20 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, boutique, contenttypes, sessions.
2021-10-29T13:15:56.434619+00:00 app[web.1]: Run 'python manage.py migrate' to apply them.
2021-10-29T13:15:56.434663+00:00 app[web.1]: October 29, 2021 - 06:15:56
2021-10-29T13:15:56.434711+00:00 app[web.1]: Django version 3.2.8, using settings 'store.settings'
2021-10-29T13:15:56.434711+00:00 app[web.1]: Starting development server at http://0.0.0.0:5000/
2021-10-29T13:15:56.434711+00:00 app[web.1]: Quit the server with CONTROL-C.
它说我有 20 个未应用的迁移,这就是它不能在线工作的原因吗?在进行迁移然后迁移时,它只是说没有要应用的迁移。
大多数人似乎建议对 Procfile 进行一些更改,但我不太了解 Procfile,也不知道要写什么或为什么要写它。无论如何,我没有找到任何似乎适用于我的应用程序的东西,其中大部分似乎与 JSON 有关。
【问题讨论】:
-
推送您的迁移,然后尝试。您需要在本地文件夹中推送迁移
-
我运行了“heroku run python manage.py migrate”并且它迁移了。我仍然崩溃,但同样的错误。
标签: python django heroku web-hosting