P
P
Python Newbie2022-02-04 17:21:18
Visual Studio Code
Python Newbie, 2022-02-04 17:21:18

How to specify directory when debugging django in vs code?

launch.json file:

{
    // Используйте IntelliSense, чтобы узнать о возможных атрибутах.
    // Наведите указатель мыши, чтобы просмотреть описания существующих атрибутов.
    // Для получения дополнительной информации посетите: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: Django",
            "type": "python",
            "request": "launch",
            "program": "${workspaceFolder}\\manage.py",
            "args": [
                "runserver"
            ],
            "django": true
        }
    ]
}


The file manage.py is not in the root of the project, but in .\web_site\manage.py

How do I tell the file to run from the .\web_site\ directory, and not .

Like doing cd .\web_site\ before starting debugging

Replace ${workspaceFolder}\\web_site\\manage.py won't help because the start directory will be .

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question