First time using Heroku. Trying to push. I have run the command:
heroku create --buildpack heroku/python
and it displayed
$ hero
For future references, you must ensure that you are pushing the branch with your code to heroku master
.
If you branched from your master
branch and all your code is on a, say, develop
, push that to the heroku master.
So instead of:
git push heroku master
You would do something like:
git push heroku develop:master
This question has important details on this How to push different local Git branches to Heroku/master
You need to create a runtime.txt file. On the command line, in the same folder as your requirements.txt file, enter echo "python-3.5.1" > runtime.txt
. Of course, make sure to switch the 3.5.1 with whichever version of Python you are using.
When deploying using Docker
, ensure to set the stack of the app to container
, as shown in the docs:
heroku stack:set container
If you've tried some of the above answers and the problem still persists;
Ensure you are git
"committing" in the right directory.
For instance, if your file structure is as follow:
/src
/...
manage.py
.gitignore
Pipfile/requirements.txt
Pipfile.lock
Procfile
runtime.txt
Ensure you're git
adding, committing, pushing etc. from the root directory. Since we work mostly in the src/
or main_app_directory/
we tend to forget to change directory back to root before committing.
One more thing to note is to actually commit your changes to your git repo, before you can push them to Heroku.
You might have a requirements.txt setup locally, but if it's not committed to your repo, git push heroku master
will not be able to locate it.