Skip to main content
Docker Pulls The django-base image provides a foundation for building Django applications with pre-configured Python environments and dependency management tools.

Supported Python Versions

Penn Labs products use different Python versions depending on compatibility requirements. Each django-base release includes both “Shared” and “Simple” tags:
  • Shared tag: [sha] - Uses the default Python version
  • Simple tag: [sha]-[python-version] - Explicitly specifies Python version

Available Tags

Tag PatternPython VersionUsed By
[sha]Python 3.11 (default)Default for new projects
[sha]-3.11Python 3.11office-hours-queue, penn-mobile, penn-courses
[sha]-3.10Python 3.10.18Legacy projects

Example Tag

For a commit SHA a142aa6975ee293bbc8a09ef0b81998ce7063dd3:
  • Shared tag: a142aa6975ee293bbc8a09ef0b81998ce7063dd3
  • Simple tag (Python 3.10): a142aa6975ee293bbc8a09ef0b81998ce7063dd3-python3.10

Features

The Django base image includes:
  • pipenv for dependency management
  • mysqlclient packages and necessary dependencies
  • Pre-configured Python environment
  • Optimized for Django applications

Usage Example

Create a Dockerfile for your Django application:
FROM pennlabs/django-base

# Copy project dependencies
COPY Pipfile* /app/

# Install project dependencies
RUN pipenv install --system

# Copy project files
COPY . /app/

# Collect static files
RUN python3.7 /app/manage.py collectstatic --noinput

Build Arguments

The django-base image supports the PYTHON_VERSION build argument to specify the Python version:
docker build --build-arg PYTHON_VERSION=3.11 .
The default Python version is 3.10 if not specified.

Build docs developers (and LLMs) love