0

I'm trying to run NetBox in a remote installation of VS Code Server on a Ubuntu VM. I have a venv activated, and in VS Code I'm pointing to venv/bin/python as the the interpreter. Despite all of this, NetBox isn't registering the --insecure flag.

Here is my launch.json showing the --insecure flag in use:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python Debugger: Django",
            "type": "debugpy",
            "request": "launch",
            "args": [
                "runserver",
                "0.0.0.0:8000",
                "--insecure"
            ],
            "django": true,
            "autoStartBrowser": false,
            "program": "${workspaceFolder}/netbox/manage.py"
        }
    ]
}

Yet running the debugger gets me the unrecognized arguments error:

root@localhost:/opt/netbox#  /usr/bin/env /opt/netbox-lab-0.0.1/.venv/bin/python /root/.local/share/code-server/extensions/ms-python.debugpy-2025.6.0-linux-x64/bundled/libs/debugpy/adapter/../../debugpy/launcher 34423 -- /opt/netbox/netbox/manage.py runserver 0.0.0.0:8000 --insecure 
usage: manage.py runserver [-h] [--ipv6] [--nothreading] [--noreload] [--version] [--settings SETTINGS] [--pythonpath PYTHONPATH] [--no-color] [--force-color]
                           [--skip-checks]
                           [addrport]
manage.py runserver: error: unrecognized arguments: --insecure

And here is the command line output showing that yes I am indeed activating the venv before running the NetBox dev server:

root@localhost:/opt/netbox# source .venv/bin/activate
(.venv) root@localhost:/opt/netbox# python netbox/manage.py runserver --insecure
usage: manage.py runserver [-h] [--ipv6] [--nothreading] [--noreload] [--version] [--settings SETTINGS] [--pythonpath PYTHONPATH] [--no-color] [--force-color]
                           [--skip-checks]
                           [addrport]
manage.py runserver: error: unrecognized arguments: --insecure
(.venv) root@localhost:/opt/netbox# 

Any ideas what I'm doing wrong?

1 Answer 1

1

The way I got past this was to blow away the venv entirely, and start fresh:

rm -rf /opt/netbox/venv
python3 -m venv venv
source /opt/netbox/venv/bin/activate
pip install -r requirements.txt
python netbox/manage.py runserver 0.0.0.0:8000 --insecure

I also made sure that the interpreter selected in VS Code was ./venv/bin/python once the new venv was created.

Still not sure why the execution context for both the debugger and the command line escaped out of the venv. That was super weird. If anyone has any idea, it would certainly help me sleep at night.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.