Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python flask on heroku

# If not intalled & logged in yet:
sudo snap install heroku --classic
heroku login

####### Sample repo by heroku #####
git clone https://github.com/heroku/python-getting-started.git
cd python-getting-started

####### Manual configs ############
#sample Procfile for flask
> web: gunicorn --bind 0.0.0.0:$PORT app:app
#populate requirements.txt
#sample py version in runtime.txt
> python-3.9.6

###### Create & Deploy ############
#create app from CLI
heroku create app-name
#every push will re-deploy the updated code
git push heroku main
#Ensure server is UP
heroku ps:scale web=1
#Continous Logging
heroku logs --tail
Source by devcenter.heroku.com #
 
PREVIOUS NEXT
Tagged: #python #flask #heroku
ADD COMMENT
Topic
Name
6+2 =