Debugging a Dockerized Django app with VSCode

Опубликовано: 11 Сентябрь 2024
на канале: London App Developer
36k
400

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

Find the blog post here:

Build a Backend REST API with Python & Django - Advanced:

Resources:
- Docker Desktop:
- Visual Studio Code:
- VSCode Docker Extension:
- VSCode Python Extension:
- One liner for creating a Django project with Docker:
- GitHub Python .gitignore file:
- Completed project code:
- More content:

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