Django in production.
One CLI command away.
Hand-tuned gunicorn + nginx Dockerfile, automatic Let's Encrypt SSL, managed Postgres, Celery worker support. Deploy to AWS, GCP, Azure, Alibaba, or Linode — same command.
The Django production stack vxcloud ships out of the box
Most Django production guides spend pages explaining gunicorn flags and nginx configs. vxcloud's `deploy django` ships sensible defaults so you can skip the YAK shaving and ship features.
Production Dockerfile
Multi-stage build, Python 3.11/3.12 slim, gunicorn with auto-tuned worker count, collectstatic at build time, migrate at startup (optional).
Let's Encrypt automation
`--enable-ssl --domain X --ssl-email Y` and Traefik handles ACME. Auto-renews on cron.
Managed Postgres in one call
`vxcli cloud database create-rds` provisions Postgres with sane Django defaults. Connection string flows in via DATABASE_URL.
Celery worker deploys
`vxcli deploy django --celery` adds a separate worker process. Or deploy the worker to a dedicated VM with `vxcli deploy nodejs --start 'celery -A myapp worker'`.
CI/CD wired in
Same `vxcli deploy django` command from a GitHub Action / GitLab CI / Jenkins pipeline. JSON output for parsing.
Multi-cloud, multi-region
Switch `--cloud aws` to `--cloud gcp` and you deploy to Google Cloud — same command. Multi-region = multiple deploys with different `--region`.
Quickstart — Django live with SSL in 3 commands
vxcli vm create \
--name web-vm --cloud aws --region us-east-1 \
--instance-type t3.small --key-pair-name AWSPRODKEY2
export WEB_IP=<paste-public-ip>vxcli cloud database create-rds django-db \
--cloud aws --region us-east-1 \
--engine postgres --version 16 \
--instance-type db.t3.micro --storage-size 20 \
--username django --password '<set-strong>' \
--db-name appvxcli deploy django \
--source-dir ./ \
--app-name api \
--wsgi-entry myproject.wsgi:application \
--requirements requirements.txt \
--app-port 8000 --http-port 80 \
--env DATABASE_URL=postgres://django:...@<rds-endpoint>/app \
--env DJANGO_SETTINGS_MODULE=myproject.settings.production \
--env SECRET_KEY='<your-key>' \
--env DJANGO_ALLOWED_HOSTS=api.example.com \
--enable-ssl --domain api.example.com --ssl-email [email protected] \
--host $WEB_IP --ssh-user ubuntu --key-pair-name AWSPRODKEY2
# https://api.example.com now serves Django with a valid cert.Adding Celery workers
Async tasks deserve their own process — and usually their own VM.
# 1) Redis for the Celery broker
vxcli cloud database create-redis celery-broker \
--cloud aws --region us-east-1 \
--node-type cache.t3.micro \
--subnet-ids subnet-aaa --vpc-security-group-ids sg-...
# 2) Deploy the worker — same Django code, different entrypoint
vxcli deploy nodejs \
--source-dir ./ \
--app-name celery-worker \
--start "celery -A myproject worker -l info" \
--env DATABASE_URL=postgres://django:...@<rds>/app \
--env CELERY_BROKER_URL=redis://<elasticache-endpoint>:6379/0 \
--env DJANGO_SETTINGS_MODULE=myproject.settings.production \
--host <worker-vm-ip> --ssh-user ubuntu --key-pair-name AWSPRODKEY2
# 3) (Optional) Celery beat for scheduled tasks — separate small VM
vxcli deploy nodejs \
--source-dir ./ \
--app-name celery-beat \
--start "celery -A myproject beat -l info" \
--env ... \
--host <beat-vm-ip> ...Django in production — the checklist that matters
- Set `DEBUG=False` and `ALLOWED_HOSTS=['your.domain']` in production settings. Both are common Heroku migration footguns.
- Use Whitenoise for static files unless your static surface is large (>500 files); then move to S3 / GCS / Azure Blob.
- Configure structured logging — `django-structlog` ships logs as JSON for ingestion into Loki / Datadog / equivalent.
- Set `CONN_MAX_AGE=60` in DATABASES — persistent DB connections cut latency under load and reduce Postgres connection pressure.
- Run migrations separately from deploys in production — `vxcli services exec api -- python manage.py migrate` lets you control timing.
- Configure `SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')` — without this Django thinks requests are HTTP because Traefik terminates TLS upstream.
- Run `python manage.py check --deploy` in CI — it catches missing security settings before deploy time.
- Sentry / Rollbar for error tracking. Configure once via env vars; Django's exception handling integrates with both via single decorators.
Django hosting FAQ
Deploy your Django app today
Free tier covers your first VM, your first managed Postgres, and the first 50 deploys per month. No credit card to start.