简体   繁体   中英

Heroku not recognizing migrations

I finally got my Heroku app to work locally at least! However, when I try to open it online it crashes with the following error:

>     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

I'm not really sure what to make of it but when I ran the app locally it said:

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.

It says I have 20 unapplied migrations, could that be why it doesn't work online? When making migrations then migrating, it just says no migrations to apply.

Most people seem to suggest some change to the Procfile but I don't understand Procfiles well and don't know what to write or why to write it. I didn't find anything which seemed to apply to my app anyway, most of it seems to be about JSON.

First of all make sure that you have the right database settings set in your projects settings,

Most people seem to suggest some change to the Procfile but I don't understand Procfiles

they probabyly suggesting you to add this line to your Procfile

release: python manage.py migrate

for more about Procfile have a look at this

also this question seems really similiar, not quite understood what is your projects flow from the information you have shared but maybe something helps at this question

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM