Skip to content

Instructions: Heroku Deployment

kes cardoso edited this page Mar 30, 2021 · 1 revision

Heroku Deployment

  1. Fulfil all Heroku requirements by freezing your dependencies and creating a Procfile:

    On the terminal (vscode):

    pip3 freeze > requirements.txt

    echo web: python app.py > Procfile

    Commit and push your changes.

  2. Open your Heroku Dashboard and create a new app. Name your app and choose your region.

  3. Add your Config Vars to Heroku.

    Navigate to the settings menu, and then to the Config Vars session, and enter here the sensitive information from your env.py file:

    import os

    os.environ.setdefault("IP", "0.0.0.0")

    os.environ.setdefault("PORT", "5000")

    os.environ.setdefault("SECRET_KEY", "secret_key_here")

    os.environ.setdefault("MONGO_URI", "value_from mongoDB_here")

    os.environ.setdefault("MONGO_DBNAME", "value_from mongoDB_here")

  4. Connect your heroku app to your git repository, by going to:

    • "Deploy" Menu > "Deployment method" > Click: "Connect to GitHub"

    • "Connect to GitHub" > search your repo from the dropdown, and connect

    • Choose a branch to deploy your changes

    • Deploy your branch and view app.

Clone this wiki locally