简体   繁体   中英

Cannot push django app to Heroku

I am trying to deploy a CMS application on Heroku. But when I try

git push heroku master

I am getting the following errors.

Counting objects: 2841, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2775/2775), done.
Writing objects: 100% (2841/2841), 13.35 MiB | 497.00 KiB/s, done.
Total 2841 (delta 917), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Python app detected
remote: -----> Installing python-3.6.6
remote: -----> Installing pip
remote: -----> Installing requirements with pip
remote:        Collecting pkg-resources==0.0.0 (from -r /tmp/build_2e9a3f2d21d5a1b3c5ab348811182510/requirements.txt (line 1))
remote:          Could not find a version that satisfies the requirement pkg-resources==0.0.0 (from -r /tmp/build_2e9a3f2d21d5a1b3c5ab348811182510/requirements.txt (line 1)) (from versions: )
remote:        No matching distribution found for pkg-resources==0.0.0 (from -r /tmp/build_2e9a3f2d21d5a1b3c5ab348811182510/requirements.txt (line 1))
remote:  !     Push rejected, failed to compile Python app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !   Push rejected to peaceful-olympic-84671.
remote: 
To https://git.heroku.com/peaceful-olympic-84671.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/peaceful-olympic-84671.git'

I have already seen many answers to this same question on stack overflow but none of the answers is working for me. Please help.

Update: Removing the pkg-resources from requirements.txt helped. But the application isn't being displayed. It says application errors, check your logs for details.

1]

This is my log file in Heroku.

2018-07-04T13:19:20.003057+00:00 heroku[web.1]: Starting process with command `gunicorn zoomtail.wsgi --log-file -`
2018-07-04T13:19:22.351320+00:00 heroku[web.1]: State changed from starting to crashed
2018-07-04T13:19:22.264506+00:00 app[web.1]: bash: gunicorn: command not found
2018-07-04T13:19:22.329998+00:00 heroku[web.1]: Process exited with status 127
2018-07-04T15:49:08.058951+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=peaceful-olympic-84671.herokuapp.com request_id=b22e6349-7456-4bfe-bb40-7be7b285e027 fwd="106.206.63.203" dyno= connect= service= status=503 bytes= protocol=https
2018-07-04T15:49:08.609553+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=peaceful-olympic-84671.herokuapp.com request_id=cb458cf7-fd71-4342-a3be-e46f258b6072 fwd="106.206.63.203" dyno= connect= service= status=503 bytes= protocol=https
2018-07-04T15:49:44.078076+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=peaceful-olympic-84671.herokuapp.com request_id=a3d03045-0204-44e4-9739-afeaa95eb1d0 fwd="106.206.63.203" dyno= connect= service= status=503 bytes= protocol=https
2018-07-04T15:49:45.057346+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=peaceful-olympic-84671.herokuapp.com request_id=dde12264-b1a6-4394-8427-4f431a292a6c fwd="106.206.63.203" dyno= connect= service= status=503 bytes= protocol=https
2018-07-04T15:52:41.870237+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=peaceful-olympic-84671.herokuapp.com request_id=95caff68-1fc2-4767-a835-e3e51fb867a8 fwd="106.206.63.203" dyno= connect= service= status=503 bytes= protocol=https
2018-07-04T15:52:42.608603+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=peaceful-olympic-84671.herokuapp.com request_id=7b5ad55a-8c59-4c92-8480-a9ed11572306 fwd="106.206.63.203" dyno= connect= service= status=503 bytes= protocol=https

I cannot make sense of the error. Please help.

在推送到heroku之前,从requirements.txt删除以下行。

pkg-resources==0.0.0

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