Topic · Delivery & releases

CI/CD pipelines for Django in production

Automated test-and-deploy pipelines on GitHub Actions, GitLab, and Bitbucket, plus the images and previews they produce.

every merge, the same stepsPushprotected branchTestwith PostgreSQLBuildimage or artifactDeploymigrate, restartVerifyhealth, smokeA failed step stops everything after it, before users see it

A pipeline runs the same steps for every change: test, build, deploy, and verify. It removes the memory-dependent parts of a manual release and leaves a record of what went where.

The guides cover GitHub Actions, GitLab CI, Bitbucket Pipelines, and preview environments, with secrets handled so that CI never holds more access than it needs.

19Set it up
2Run it well
1Check it
5Fix it

Set it up

Guides that take this from nothing to running in production.

  • Deploy Django with GitHub Actions CI/CD

    Manual Django deployments usually fail in predictable ways: someone forgets to run migrations, static files are outdated, the wrong branch gets pushed to production, or a restar...

  • Deploy Django with GitLab CI/CD

    Build a GitLab CI/CD pipeline for Django: PostgreSQL tests, Docker image builds, SSH deploys with protected variables, and one-click rollbacks.

  • Deploy Django with Bitbucket Pipelines

    Build a Bitbucket Pipelines CI/CD workflow for Django: tests against a PostgreSQL service, cached dependencies, deployment environments, SSH deploys, and a manual production gate.

  • Preview Environments for Django Pull Requests

    Spin up a temporary Django environment for every pull request: GitHub Actions, Docker Compose on a preview host, wildcard subdomains, per-PR databases with seed data, and automatic teardown.

  • Deploy Django Docker Images from GitHub Container Registry

    Build Django images in GitHub Actions, push them to GHCR with immutable tags, pull them on servers with read-only credentials, deploy by tag or digest, and clean up old versions.

  • Deploy Django With a Jenkins Pipeline

    Build a Jenkins pipeline for Django: a declarative Jenkinsfile that runs tests against PostgreSQL in Docker, builds and pushes an image, deploys over SSH with migrations, uses credentials binding, and gates production behind approval.

  • Deploy Django With CircleCI

    Set up CircleCI for a Django project: a config.yml with a PostgreSQL service image, dependency caching, parallel test splitting, Docker image builds, and an SSH or registry-based deploy job gated by branch filters and approval.

  • Deploy Django With Azure DevOps Pipelines

    Build an Azure Pipelines YAML pipeline for Django: test with a PostgreSQL service container, publish an image to Azure Container Registry, deploy to App Service or a VM through environments with approvals, and keep secrets in variable groups or Key Vault.

  • Test and Deploy Django With Buildkite

    Build a Buildkite pipeline for Django: run tests with PostgreSQL on self-hosted agents using the Docker Compose plugin, build and push images, gate production deploys with block steps, run migrations, and keep secrets out of pipeline YAML.

  • Test and Deploy Django With Woodpecker CI

    Set up Woodpecker CI, a lightweight self-hosted CI engine, for Django: write .woodpecker.yaml pipelines with a PostgreSQL service, run tests and linting, build and push images with the buildx plugin, deploy over SSH on main, and manage secrets.

  • Deploy Django to AWS From GitHub Actions With OIDC (No Access Keys)

    Replace long-lived AWS access keys in GitHub Actions with OpenID Connect: create the GitHub OIDC provider and an IAM role with a trust policy scoped to your repo and branch, assume it with aws-actions/configure-aws-credentials, and push to ECR and deploy ECS.

  • Test and Deploy Django With Gitea or Forgejo Actions

    Use Gitea Actions or Forgejo Actions, GitHub Actions-compatible CI built into self-hosted forges, for Django: register act_runner, write workflows with a PostgreSQL service, push images to the built-in container registry, and deploy over SSH with secrets.

  • Set Up a Staging Environment for Django

    Build a Django staging environment that catches real release problems: production parity, isolated data and secrets, and safe side effects.

  • Deploy Django with Argo CD (GitOps)

    Deploy Django to Kubernetes with Argo CD: a config repository, an Application with automated sync, PreSync migration hooks, CI-driven image tag updates, and rollback by git revert.

  • Build Multi-Architecture Django Docker Images

    Build Django images for both amd64 and arm64 (Graviton, Ampere, Apple Silicon) with docker buildx: QEMU versus native runners, wheels, caching in GitHub Actions, and verifying manifests.

  • Compile Django Translations During Deployment

    Ship Django translations reliably: run compilemessages in CI or a Docker build stage with gettext, ignore virtualenvs, validate .po files, restart workers, and verify every language in production.

  • Deploy Django With git push and a post-receive Hook

    Deploy Django to your own server with git push production main: a bare repository with a post-receive hook that checks out the code, installs dependencies, runs migrations and collectstatic, and reloads Gunicorn, with safe failure handling.

  • Build Django Images With Cloud Native Buildpacks

    Build production Django container images without a Dockerfile using Cloud Native Buildpacks and the pack CLI: choose a builder, configure Python version and start command with a Procfile, run collectstatic, rebase images for OS patches, and use it in CI.

  • Sign and Verify Django Docker Images With Cosign

    Sign Django container images with Sigstore Cosign in CI using keyless signing through GitHub Actions OIDC, attach SBOM and provenance attestations, and verify signatures before deploy or with a Kubernetes admission policy.

Run it well

Tuning, reliability, and operations once it works.

Check it

Review lists to run before launch or after a change.

  • Django CI/CD Pipeline Checklist

    A checklist for a Django CI/CD pipeline: tests on the production database engine, migration checks, linting and security scans, building one artefact, deploying migrations safely, smoke tests, approvals, rollback, and secrets handling.

Fix it

Errors and symptoms, each traced to a cause and a fix.

Learning paths through this topic

Related topics