Steps to create a postgres database and deply a Python app to Heroku
pipenv install gunicorn
or
pip install gunicorn
https://devcenter.heroku.com/articles/heroku-cli
heroku login
heroku create appname
heroku addons:create heroku-postgresql:hobby-dev --app appname
heroku config --app appname
# Add to your app
touch Procfile
# Add this
web: gunicorn app:app
pip freeze > requirements.txt
touch runtime.txt
# Add this
python-3.7.2
git init
git add . && git commit -m 'Deploy'
heroku git:remote -a appname
git push heroku master
heroku run python
>>> from app import db
>>> db.create_all()
>>>exit()
heroku open
I am having issue with git push command. Could anyone tell me how to resolve it?
(env) C:\Users\namra\Desktop\Feedback form>git push heroku master
Enumerating objects: 1020, done.
Counting objects: 100% (1020/1020), done.
Delta compression using up to 8 threads
Compressing objects: 100% (995/995), done.
Writing objects: 100% (1020/1020), 4.68 MiB | 3.83 MiB/s, done.
Total 1020 (delta 71), reused 0 (delta 0), pack-reused 0
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: ! Requested runtime (python 3.7.2) is not available for this stack (heroku-18).
remote: ! Aborting. More info: https://devcenter.heroku.com/articles/python-support
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to burgerfeedback.
remote:
To https://git.heroku.com/burgerfeedback.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/burgerfeedback.git'