Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run Django server using the run button in visual studio code

In pyCharm we have this option where we can configure Run button to start the server by adding the same to the script path.

enter image description here

I wanted to do the same in visual studio code, so that whenever I click Run, my django server gets started.

like image 802
Himanshu Poddar Avatar asked Feb 23 '26 05:02

Himanshu Poddar


1 Answers

You need to create a launch.json in the folder .vscode which sits in the same folder as your manage.py.

// Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: 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
        },
    ]
}

You can create one by clicking run & debug and then at top menu green triangle click add configuration -> python -> Django

like image 106
Bruno Vermeulen Avatar answered Feb 24 '26 19:02

Bruno Vermeulen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!