dailylog 8-14-20

less than 1 minute read

Fastest Flask App Yet

STEP 1: Make the thing

mkdir your_app
cd your_app
python3 -m venv venv
source venv/bin/activate
pip3 install flask
git init
pip3 install gunicorn
pip3 freeze > requirements.txt
touch Procfile

STEP 2: Add this to Procfile

web: gunicorn app:server

STEP 3: Add actual app.py

app.py

from flask import Flask

app = Flask(__name__)

@app.route('/')
def index():
    return "Hello, world!"

if __name__ == "__main__":
    app.run(debug=True)

STEP 4: PUSH IT LIVE

heroku create your_app
git add .
git commit -m "WHEEE FLASK"
git push heroku master
heroku open