Deployment is getting your app running somewhere users can reach it. There's a spectrum from "push code and forget" to full control — the right choice depends on your needs and how much infrastructure you want to manage.
The options
- Platform-as-a-Service (Render, Railway, Fly.io) — push your code and they build, run and scale it. Easiest, great default.
- Containers — deploy your Docker image to a container host or Kubernetes for portability and control.
- Virtual server — a VM you configure yourself. Most control, most responsibility.
Running a web app
A Python web app runs behind a production-grade server, not the development server. Use gunicorn (WSGI) or uvicorn (ASGI, for async frameworks like FastAPI), typically behind a reverse proxy (nginx) that handles TLS and static files.
The twelve-factor rule
Key takeaways
- 01Deploy via PaaS (easiest), containers, or a self-managed server (most control).
- 02Run web apps behind gunicorn/uvicorn and a reverse proxy — not the dev server.
- 03Keep config and secrets in environment variables, never in code.
- 04One build artifact runs in every environment, configured externally.
