我終于讓我的 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 相關。
uj5u.com熱心網友回復:
首先確保您在專案設定中設定了正確的資料庫設定,
大多數人似乎建議對 Procfile 進行一些更改,但我不了解 Procfile
他們可能會建議您將此行添加到您的 Procfile
release: python manage.py migrate
有關 Procfile 的更多資訊,請查看此
這個問題似乎也很相似,不太明白你的專案是從你共享的資訊中流出的,但也許對這個問題有幫助
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/344681.html
