Debugging a Dockerized Django app with VSCode

Опубликовано: 11 Март 2025
на канале: London App Developer
37,235
416

How to create and debug a Django app that runs in Docker when using VSCode.

Find the blog post here: https://londonappdeveloper.com/2021/0...

Build a Backend REST API with Python & Django - Advanced: https://londonapp.dev/c2

Resources:
Docker Desktop: https://www.docker.com/products/docke...
Visual Studio Code: https://code.visualstudio.com/
VSCode Docker Extension: https://marketplace.visualstudio.com/...
VSCode Python Extension: https://marketplace.visualstudio.com/...
One liner for creating a Django project with Docker: https://londonappdeveloper.com/2021/0...
GitHub Python .gitignore file: https://github.com/github/gitignore/b...
Completed project code: https://github.com/LondonAppDeveloper...
More content: https://londonappdeveloper.com

00:00 - WHY we use Docker
01:36 - What we’re doing in this tutorial
01:57 - Installing dependencies
02:58 - Create new directory to use for project
03:35 - Open project in VSCode
03:48 -Add README.md file
04:07 - Add .gitignore file for the Python project
04:58 - Creating a Django project within our directory
06:18 - One line command to create Django project in Docker
10:50 - Create the template Docker configuration files in VSCode
13:00 - Modify the template files
14:07 - Modify our Docker file
15:58 - Build our Docker image
16:30 - Start our service
17:02 - Make changes to Docker compose file so VSCode debugger works
17:48 - Change the launch file
18:57 - Test the debugger tools
19:13 - Add a new sample Django view to use for testing
19:53 - Wire views up to urls.py
20:30 - Place a breakpoint in code to test
21:18 - Testing the debugger