VSCode task to run Django server and open Firefox

15 Views Asked by At

I'm trying to make a task that runs the Django server and opens Firefox.

I've tried with

{
    "version": "2.0.0",
    "tasks": [
       {
            "label": "Django Server",
            "type": "shell",
            "command": "(python manage.py runserver &); sleep 10 && firefox http://127.0.0.1:8000",
            "group": {
                "kind": "build",
                "isDefault": true
            }
       }
    ]
}

The browser displays "Unable to connect". Refreshing the page doesn't help. Everything works fine if I run python manage.py runserver on the command line and then open http://127.0.0.1:8000 in Firefox manually.

NOTE: everything works as expected when I switch firefox for chromium in the command field.

0

There are 0 best solutions below