Skip to content

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

  1. Create a sitePython
  2. Create Site
  3. Open Edit Site and set versions and commands

Settings

SettingGuidance
Python versionChoose a supported version compatible with your application and dependencies
Start commandDefault often uvicorn server:app --host 0.0.0.0 --port 8000
App PortMatch 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.txt
  • requirements-prod.txt
  • pyproject.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/health

Leave 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.

Customer documentation · Nusite IT Consulting Limited