Back to blog

Set up a Python Django Pipeline

Published March 12, 2026

In this post we will show how to set up Python/Django project and run it through a Zippy build pipeline. Django is a high-level Python web framework that encourages rapid development and clean, pragmatic design.

You could install django as following:

python -m pip install Django

Once installed you have the option to start a new project with the django-admin command

django-admin startproject pythondemo

This creates a project inside pythondemo, where we could try a little test, to see if it works.

python manage.py test

Found 0 test(s).
System check identified no issues (0 silenced).

----------------------------------------------------------------------
Ran 0 tests in 0.000s

NO TESTS RAN

Let’s add ruff to do some linting:

pip install ruff

ruff check .
All checks passed!

To verify the setup, let’s add a few tests

from django.test import TestCase, Client
from django.urls import reverse


class AdminURLTest(TestCase):
    """Test the Django admin URL."""

    def setUp(self):
        self.client = Client()

    def test_admin_url_exists(self):
        """Test that the admin URL is accessible."""
        response = self.client.get(reverse('admin:index'))
        self.assertEqual(response.status_code, 302)  # Redirects to login


class SettingsTest(TestCase):
    """Test project settings."""

    def test_database_configured(self):
        """Test that database is configured."""
        from django.conf import settings
        self.assertIn('default', settings.DATABASES)
        self.assertEqual(
            settings.DATABASES['default']['ENGINE'],
            'django.db.backends.sqlite3'
        )

    def test_installed_apps(self):
        """Test that required apps are installed."""
        from django.conf import settings
        required_apps = [
            'django.contrib.admin',
            'django.contrib.auth',
        ]
        for app in required_apps:
            self.assertIn(app, settings.INSTALLED_APPS)
python manage.py test
Found 3 test(s).
Creating test database for alias 'default'...
System check identified no issues (0 silenced).
...
----------------------------------------------------------------------
Ran 3 tests in 0.005s

OK
Destroying test database for alias 'default'...

Let’s see if we could make our build pipeline work with python. We will create a file called zippy.sh

#!/bin/bash
set -e
# Check python exists
if ! command -v python3 &> /dev/null; then
    echo "Error: python3 is not installed or not in PATH"
    exit 1
fi

# Create venv if it doesn't exist
if [ ! -d "venv" ]; then
    echo "Creating venv..."
    python3 -m venv venv
fi
 
# Activate venv
source venv/bin/activate
 
# Install dependencies
echo "Installing django and ruff..."
pip install django ruff


echo "Running ruff linter..."
ruff check .

echo "Running ruff formatter..."
ruff format .

echo "Running tests..."
python manage.py test

echo "All checks passed!"

If i run this locally, it will work:

Great, now the step to actually bring this to a centralized continuous integration pipeline is very easy. Only 2 things left, the first we need to install python on our zippy build pipeline.

Add ubuntu.sh

#!/bin/bash
set -e

sudo apt-get update -y
sudo apt-get install -yq python3-venv python3-pip 

And that’s it!

With just two shell scripts, ubuntu.sh to set up your environment and zippy.sh to run your pipeline! Every push will lint, format, and test your code automatically.

Try it. One minute to set up.

If you've ever waited for a CI runner to spin up, you'll get why this exists.

14-day Pro trial. No credit card.