YAML configuration
Keep common defaults and server overrides in
deploy/<app>/<environment>/deployment.yml.
Define repeatable SSH-based Django deployment workflows with simple YAML playbooks.
FastAPI support is planned next.
$ pystrano deploy production api
✓ Connecting to production api (app1.example.com)
✓ Prepared release directory
✓ Pulled branch main
✓ Synced shared assets and env file
✓ Installed Python dependencies
✓ Applied migrations and refreshed static assets
✓ Promoted release to current
✓ Restarted gunicorn.service
✅ Deployment completed in 42s
Pystrano automates the SSH deployment steps you would otherwise keep in shell notes: prepare a server, create timestamped releases, install dependencies, run Django management commands, update the active release, and restart the app service.
Keep common defaults and server overrides in
deploy/<app>/<environment>/deployment.yml.
Run setup once, then deploy releases that can install
requirements.txt, run migrations, collect static files, and restart systemd.
Deploys create timestamped release directories and promote the active release with
a current symlink. A rollback CLI command is not exposed yet.
Pystrano assumes you already have SSH access to a VPS-style server and know where your Django app should live.
Define repository, deploy user, virtualenv path, service file, environment file, and per-server Django options.
Use pystrano setup production api to create the deploy user,
directories, packages, virtualenv, known hosts, and optional service files.
Use pystrano deploy production api to clone code, install
dependencies, run Django tasks, promote the release, and prune old releases.
The docs focus on the supported workflow today: deploying Django apps over SSH with Gunicorn and systemd on VPS-style servers.
common:
source_code_url: "git@github.com:example/example-django-app.git"
project_root: "apps/example-django-app"
project_user: "deploy"
venv_dir: ".venv"
keep_releases: 5
system_packages: |
libpq-dev
python3-dev
build-essential
env_file: "./deploy/api/production/.env"
ssh_known_hosts: "github.com"
service_file: "./deploy/api/production/gunicorn.service"
branch: "main"
clone_depth: 1
servers:
- host: "app1.example.com"
port: 22
run_migrations: true
collect_static_files: true
pystrano setup production api --dry-run
pystrano deploy production api --dry-run
Install Pystrano, create a deployment config, preview the remote commands, then run setup and deploy when your server is ready.