-
Notifications
You must be signed in to change notification settings - Fork 2
Instructions: Heroku Deployment
-
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.
-
Open your Heroku Dashboard and create a new app. Name your app and choose your region.
-
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")
-
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.
-