Deploy Flask / Python
How nesly detects, builds and serves a Flask / Python project — and the two commands that put it on a live URL.
Deploy Flask / Python on nesly
A Flask / Python project is built into a container and run as a server process.
cd your-project
nesly deploy --yesThe first deploy creates the project and prints the live URL; after that,nesly deploy is enough.
How detection sees it
- A Flask app (Flask( in a .py file + requirements.txt/pyproject.toml) runs as a container, usually via gunicorn.
- The first deploy mints SECRET_KEY and stores it on the project — the same value on every later deploy.
When detection is not what you want, say it yourself: build and start commands, root directory and output directory live in nesly.tomlcommitted next to the code — see builds.
Worth knowing
- gunicorn (or flask run) must bind 0.0.0.0 and the PORT environment variable.
- If you delete SECRET_KEY, set it again with nesly env set (or redeploy after clearing it so a new one is minted).
- Attach a managed database with
nesly addon add postgres(ormssql) — connection env vars are injected on the next deploy. - When a deploy fails,
nesly diagnosereads the logs for you and names the fix.
Full walkthrough: get started. Custom domains, backups, GitHub deploys and the rest of the reference: nesly CLI.