Muhammad Kamal
Muhammad Kamal

Reputation: 29

How to setup VScode debugger in cookiecutter django template?

File: docker-compose.debug.yml

version: '3.4'

services:
  vscodedjangodocker:
    image: vscodedjangodocker
    build:
      context: .
      dockerfile: ./Dockerfile
    command: ["sh", "-c", "pip install debugpy -t /tmp && python /tmp/debugpy --wait-for-client --listen 0.0.0.0:5678 manage.py runserver 0.0.0.0:8000 --nothreading --noreload"]
    ports:
      - 8000:8000
      - 5678:5678
  

FIle name: lunch.json

{
    "configurations": [
        {
            "name": "Docker: Python - Django",
            "type": "docker",
            "request": "launch",
            "preLaunchTask": "docker-run: debug",
            "python": {
                "pathMappings": [
                    {
                        "localRoot": "${workspaceFolder}/app",
                        "remoteRoot": "/app"
                    }
                ],
                "projectType": "django"
            }
        }
    ]
}

File name: tasks.json

{
    "configurations": [
        {
            "name": "Docker: Python - Django",
            "type": "docker",
            "request": "launch",
            "preLaunchTask": "docker-run: debug",
            "python": {
                "pathMappings": [
                    {
                        "localRoot": "${workspaceFolder}/app",
                        "remoteRoot": "/app"
                    }
                ],
                "projectType": "django"
            }
        }
    ]
}

i did implement it in normal django docker project vscode-django-docker-debugging it work just fine but cant seem to implement into the cookecutter django template.

when i try to implement it into the cookecutter Django template im getting .env error.

Did anyone implement VScode docker debugger in cookecutter django. please do share.

I want to implement cookecutter docker debugger vscode.

Upvotes: 0

Views: 134

Answers (0)

Related Questions