How microsoftdocs/pipelines-python-django works
Project type and purpose
• This is a simple, monolithic Django web-application written in Python.
• Its primary purpose is to serve as a sample app for demonstrating Azure Pipelines: building, testing, containerizing (via Docker), and pushing to Docker Hub or Azure Container Registry.
File structure
• Top-level files:
• Dockerfile – container image definition
• azure-pipelines.yml / azure-pipelines.docker.yml / azure-pipelines.acr.yml – CI/CD pipeline definitions
• manage.py – Django management CLI
• test_site.py – test harness for the application
• Folder “helloworld”: contains a minimal Django MVC app
• settings.py – configuration
• urls.py – URL routing
• wsgi.py – WSGI entrypoint
• __init__.py – package marker
Key insights from README
• Demonstrates three Azure Pipelines scenarios:
• Plain build/test (Python)
• Build and push Docker image to Docker Hub
• Build and push Docker image to Azure Container Registry
• No external database is explicitly defined here (the sample likely uses Django’s default SQLite or an in-memory DB for demo purposes).
Main components
a. Developer & Git repository
b. Azure DevOps – Pipelines (YAML):
• Build & test stage (runs manage.py tests or test_site.py)
• Docker build stage (uses Dockerfile)
• Push stage (to Docker Hub or ACR)
c. Container registry(s): Docker Hub / Azure Container Registry
d. Runtime environment: Azure Web App / Azure Kubernetes Service (AKS) or any Docker-compatible host
e. Application internals:
• Django MVC layers (URLs → Views → Templates / Models)
• WSGI server process
Relationships and interactions
• Developer commits code → triggers Azure Pipelines
• Pipeline fetches repo → runs tests via test_site.py / manage.py
• On success → Dockerfile builds container image
• Image is tagged & pushed to chosen registry (Docker Hub or ACR)
• Deployment step (not in sample but implied) pulls image from registry → runs on Azure host
Architectural patterns and design principles
• Monolithic MVC web application (Django)
• CI/CD pipeline as code (YAML)
• Containerization for environment consistency
• “Pipeline → Registry → Host” deployment flow
Technologies, frameworks, libraries
• Python 3.x, Django framework
• Docker (containerization)
• Azure DevOps Pipelines (YAML)
• Azure Container Registry / Docker Hub
• WSGI server (built into Django wsgi.py)
Detail level
• Inside the “Django App” container, list key sub-components: settings, URL router, WSGI entrypoint