Skip to content

Hosting on Heroku

Christopher Martin edited this page Aug 3, 2021 · 3 revisions

Step 1: Navigate to https://heroku.com/ and sign up

Step 2: Read through the Terms of Service and click "Accept"

Step 3: Navigate to https://dashboard.heroku.com/apps and click "Create a new app"

Step 4: Enter a unique app name and click "Create app"

Step 5: Navigate to https://elements.heroku.com/addons/heroku-postgresql and click "Install Heroku Postgres"

Step 6: Select the "Hobby Dev - Free" Add-on plan and enter your unique app name as the provisioned app

Step 7: Click "Submit Order Form"

Step 8: Click "Heroku Postgres"

Step 9: Navigate to the settings tab

Step 10: Click "View Credentials..."

Step 11: Copy the URI value into your .env file as the value for the DATABASE_URL variable

Your .env file should look something like this:

DIALOGFLOW_PROJECT_ID=classroom-assistant
GOOGLE_APPLICATION_CREDENTIALS=path/to/credential/file.json

SLACK_CLIENT_ID=#############.#############
SLACK_CLIENT_SECRET=????????????????????????????????
SLACK_SIGNING_SECRET=????????????????????????????????

FLASK_APP=main.py
FLASK_ENV=production
FLASK_RUN_HOST=0.0.0.0
FLASK_RUN_PORT=3000

DATABASE_URL=postgres://********************************:********************************:****/******************

Step 12: Navigate to https://devcenter.heroku.com/articles/heroku-cli and follow the download guide

Step 13: Return to the "Deploy" tab of your Heroku app and follow the Heroku CLI guide

To verify the upload, navigate to the "Overview" tab

To confirm the application is running, scroll up and click "View logs" under the "More" section