daily log 12.08.20
Deploying a python app to Heroku
- Create Virtual Environment:
python -m venv my-app-venv
- Activate Virtual Environment:
source my-app-venv/bin/activate
- Install dash + other dependencies
pip install dash dash-core-components dash-html-components plotly gunicorn
- Add files we’ll need for heroku deployment
touch .gitignore Procfile
pip freeze > requirements.txt
- heroku login
- heroku create your-amazing-app-name
- git add .
- git commit -m “To heroku we go”
- **ADD ENV VARIABLES TO HEROKU!! **
heroku config:set API_KEY=sdlfjsdlfksjdlfkj
- git push -u heroku master
Procfile
web: gunicorn Your-main-file-without-the-dot-py:server