All templates

Deploy Flask on Rebasable

Flask 3 served by gunicorn.

Runtime: python Free instance pythonapi

How it works

The build installs requirements.txt and gunicorn serves app:app on $PORT with two workers. Logs go to stdout, so they show up live in the dashboard and in rebasable logs -f.

Run it locally

python -m venv .venv && . .venv/bin/activate
pip install -r requirements.txt
python app.py   # http://localhost:5000

Use it as your own repository

Copy the flask folder of the templates repository into a new repo (the files at the root, rebasable.yaml included) and push it. Then add a Deploy button to its README, or create it from Blueprints, New blueprint in the dashboard. From then on, every push deploys, and pull requests get preview environments.

Good to know

  • Behind the edge, wrap the app with werkzeug.middleware.proxy_fix.ProxyFix if you build absolute URLs.
  • Sessions need a SECRET_KEY: add it to rebasable.yaml with generateValue: true.