Theme
Python sites
Run Django, Flask, or FastAPI with release-local virtual environments and the same Git deployment lifecycle as Node.
Who can use this page? Site Manager.
Create
- Create a site → Python
- Create Site
- Open Edit Site and set versions and commands
Settings
| Setting | Guidance |
|---|---|
| Python version | Choose a supported version compatible with your application and dependencies |
| Start command | Default often uvicorn server:app --host 0.0.0.0 --port 8000 |
| App Port | Match the app port (usually 8000) |
Application root, deployment Start command, Health-check path, and Frontend asset build command are configured in Site Actions → Git Deployment. A health-check endpoint must respond without authentication.
Runtime images use official python:<minor>-slim tags.
Git deployment dependencies
Manifest in the application root (or conventional backend/):
requirements.txtrequirements-prod.txtpyproject.toml
NitHost creates a release-local .venv using the site’s Python version.
Frontend + backend layout
Example for frontend/ + backend/:
text
Application root: .
Frontend asset build: cd frontend && npm ci && npm run build
Start command: uvicorn backend.server:app --host 0.0.0.0 --port 8000
Health check: /api/healthLeave frontend build blank for API-only repos.
Git release environment and files
- Sensitive variables are not exposed to dependency installs or frontend builds
- Release filesystem is read-only at runtime — store uploads in MongoDB/GridFS, object storage, or another managed persistent service
Git deployments
Python supports immutable releases, health checks, rollback, and auto-deploy like Node — Node.js & Python contracts.