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 have a SQLITE db file already with data, and I'd like to deploy to Heroku. How can I do?
When I tried to create postgresql table on heroku python cli this error happened and won't let me create the table:
My app repository is in: https://github.com/guimatheus92/Game-Recommendation-System
My app file is in init.py: