Add Gunicorn, push, and the app is live. Want a working repo first? Deploy the flask starter from Templates.
Dependencies
# requirements.txt
flask
gunicorn
Start command
Assuming your app object is app in app.py:
web: gunicorn app:app --bind 0.0.0.0:$PORT
Config and database
wokku apps:create my-app
wokku config:set my-app SECRET_KEY="$(python -c 'import secrets; print(secrets.token_urlsafe(32))')"
wokku addons:shared:enable my-app postgres # optional
The add-on sets DATABASE_URL; read it in your SQLAlchemy config. See Create & Link a Database.
Deploy and migrate
git remote add wokku git@git.wokku.cloud:my-app
git push wokku main
wokku run my-app -- flask db upgrade # if you use Flask-Migrate
Live at https://my-app.wokku.app. First deploy? See the Quickstart.
Troubleshooting
ModuleNotFoundError— add the package torequirements.txt.- App object not found —
gunicorn app:appismodule:variable; match your file and variable names. - Can’t reach the database — check
wokku config my-appshowsDATABASE_URL.