Joel-hanson / django-docker-pdb

An example that demonstrates how to add a breakpoint to Django projects within a Docker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

django_docker_pdb

Companion repository to https://joel-hanson.medium.com/how-to-use-pdb-for-django-inside-a-docker-12c424d880ec

Set up

# Clone this repository
$ git clone git@github.com:Joel-hanson/django-docker-pdb.git

# Build Docker containers
$ docker-compose up --build

Demonstrating accessing PDB containers

Requests to the site root are handled by a function that contains a Python pdb statement. This provides a breakpoint to code execution.

To drop into this breakpoint:

# Attach into the container
$ docker attach django-docker-pdb_web_1

# Make a request to http://localhost
# You will see the breakpoint visible in your terminal

About

An example that demonstrates how to add a breakpoint to Django projects within a Docker


Languages

Language:Python 97.0%Language:Dockerfile 3.0%