daily log 12.08.20

less than 1 minute read

Deploying a python app to Heroku

  1. Create Virtual Environment: python -m venv my-app-venv
  2. Activate Virtual Environment: source my-app-venv/bin/activate
  3. Install dash + other dependencies pip install dash dash-core-components dash-html-components plotly gunicorn
  4. Add files we’ll need for heroku deployment touch .gitignore Procfile
  5. pip freeze > requirements.txt
  6. heroku login
  7. heroku create your-amazing-app-name
  8. git add .
  9. git commit -m “To heroku we go”
  10. **ADD ENV VARIABLES TO HEROKU!! ** heroku config:set API_KEY=sdlfjsdlfksjdlfkj
  11. git push -u heroku master

Procfile

web: gunicorn Your-main-file-without-the-dot-py:server