Reputation: 241
I read all the previous posts about it but still couldn't correct it. I added requirements.txt and Procfile in the directory in my computer created by Heroku. Procfile reads "web: python Chat Server.py". Also added runtime.txt in the same directory that reads "python-3.6.2".However, it keeps giving the same error again in the command prompt. How can I solve this? This is the entire error message:
"C:\Users\asus\chat_server>git push heroku master Counting objects: 6, done. Delta compression using up to 4 threads. Compressing objects: 100% (4/4), done. Writing objects: 100% (6/6), 1.14 KiB | 585.00 KiB/s, done. Total 6 (delta 1), reused 0 (delta 0) remote: Compressing source files... done. remote: Building source: remote: remote: -----> App not compatible with buildpack: https://codon-buildpacks.s3.amazonaws.com/buildpacks/heroku/python.tgz remote: More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure remote: remote: ! Push failed remote: Verifying deploy... remote: remote: ! Push rejected to boiling-stream-15219. remote: To https://git.heroku.com/boiling-stream-15219.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/boiling-stream-15219.git' "
Upvotes: 3
Views: 12714
Reputation: 2398
Anyone reading this: you'll need two files:
First file:
requirements.txt
containing something like:
gunicorn==19.7.1
or whatever the results of pip freeze > requirements.txt
are.
Second file:
Procfile
containing something like:
web: gunicorn app:app
or potentially blank. Note that app:app
in this example is a reference to your python filename. It means that every time a web
process is declared, and a dyno of this type is started, also run the command gunicorn app:app
to start your web server.
Then git add .
and git commit -m "added Procfile and requirements.txt"
.
Then run git push heroku master
to push from your local master
branch to the heroku
remote.
Upvotes: 9
Reputation: 741
In addition to JaredH's answer, make sure that your current branch is master before you run git push heroku master
.
Upvotes: 3