This repo is an abridged, updated, somewhat simpler version of this guide to getting a web app published on Heroku:
http://www.compjour.org/lessons/flask-single-page/hello-tiny-flask-app/
You can see a live-version here:
homepage: https://compjour-2017-danfoo.herokuapp.com/
hello/
endpoint: https://compjour-2017-danfoo.herokuapp.com/hello/Stanford-loremipsum
cage/
endpoint: https://compjour-2017-danfoo.herokuapp.com/cage/600/200
Assumes you have:
-
Installed Python 3.x via Anaconda on your computer, which should include Flask, among other things.
-
Created a Heroku account
-
Have Git installed (which you probably do if you installed the Github Desktop app at some point)
-
Install the
gunicorn
web server library by running at your Terminal:$ pip install gunicorn
-
Install the Heroku CLI
-
At your Terminal, run:
$ heroku login
-
Go to this page on the Heroku website to make a new app: https://dashboard.heroku.com/new-app
The example below pretends that your app on Heroku is named: compjour-2017-danfoo
- Make a new directory in your own computer. It can be called anything, doesn't have to be what you named it on Heroku, e.g.
my-heroku-foo
- Change into that directory from the command line, then run
git init
- Then run:
heroku git:remote -a compjour-2017-danfoo
. This command points your local folder to the repo (remote folder) that Heroku uses to read code and deploy its app.
You'll need the following files that are in this repo (of which the README you're reading right now):
├── Procfile
├── app.py
├── .gitignore
├── requirements.txt
└── runfile.txt
Create those files manually. Copy the contents.
Then run these shell commands:
- Run
git add .
- Run
git commit -m 'first'
- Run
git push heroku master
The above steps are the bare-bones way to get a trivial "web app" onto the Heroku service. Check out the fuller guide here, which covers more about what a Flask app/web app is:
http://www.compjour.org/lessons/flask-single-page/hello-tiny-flask-app/
via Reade Levinson:
https://sleepy-woodland-12710.herokuapp.com/
The repo for the code: https://github.com/readelev/final-app