简体   繁体   中英

Django Deploy to heroku: Application Error

I deployed my Django project to heroku. It deployed successfully but the page shown Application error. In logs on heroku error be like this.

2020-04-24T05:34:09.500250+00:00 app[web.1]: [2020-04-24 05:34:09 +0000] [4] [INFO] Using worker: sync
2020-04-24T05:34:09.506988+00:00 app[web.1]: [2020-04-24 05:34:09 +0000] [10] [INFO] Booting worker with pid: 10
2020-04-24T05:34:09.532649+00:00 app[web.1]: [2020-04-24 05:34:09 +0000] [11] [INFO] Booting worker with pid: 11
2020-04-24T05:34:10.051702+00:00 heroku[web.1]: State changed from starting to up
2020-04-24T05:34:20.000000+00:00 app[api]: Build succeeded
2020-04-24T05:34:26.126726+00:00 app[web.1]: [2020-04-24 05:34:26 +0000] [4] [INFO] Shutting down: Master
2020-04-24T05:34:41.808971+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=GET path="/favicon.ico" host=dashboard-retail.herokuapp.com request_id=f5feaeba-075f-4dc7-a637-fe6b271f0d67 fwd="125.24.11.115" dyno=web.1 connect=1ms service=30003ms status=503 bytes=0 protocol=https
2020-04-24T05:34:42.096139+00:00 app[web.1]: [2020-04-24 05:34:42 +0000] [4] [CRITICAL] WORKER TIMEOUT (pid:10)

In Procfile,I set like this

web: gunicorn myWeb.wsgi --log-file -

Help me please. Thank.

It looks like gunicorn listens on a wrong port, not on which buildpack awaits, so you get 503 error. Try to add the $PORT into your Procfile

web: gunicorn myWeb.wsgi --log-file - --bind 0.0.0.0:$PORT

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