DEV Community

Instinct
Instinct

Posted on

1

Working Directory not configuring Visual Studio 2019

I am creating a django site and I have created django project inside an app folder of the root directory.

My folder structure looks like this

.
├── .gitignore
├── .travis.yml
├── .vs
│   ├── PythonSettings.json
│   ├── VSWorkspaceState.json
│   ├── launch.vs.json
│   ├── recipe-app-api
│   │   └── v16
│   │       └── .suo
│   └── slnx.sqlite
├── Dockerfile
├── LICENSE
├── README.md
├── app
│   ├── app
│   │   ├── __init__.py
│   │   ├── __pycache__
│   │   │   ├── __init__.cpython-37.pyc
│   │   │   ├── calc.cpython-37.pyc
│   │   │   ├── settings.cpython-37.pyc
│   │   │   ├── tests.cpython-37.pyc
│   │   │   └── urls.cpython-37.pyc
│   │   ├── calc.py
│   │   ├── settings.py
│   │   ├── tests.py
│   │   ├── urls.py
│   │   └── wsgi.py
│   └── manage.py
├── docker-compose.yml
└── requirements.txt

I have configured my launch.vs.json file like this

{
  "version": "0.2.1",
  "defaults": {},
  "configurations": [
    {
      "type": "python",
      "interpreter": "(default)",
      "interpreterArguments": "",
      "scriptArguments": "",
      "env": {},
      "nativeDebug": false,
      "webBrowserUrl": "",
      "project": "app\\manage.py",
      "name": "manage.py",
      "workingDirectory": "app"
    }
  ]
}

The problem still is that Visual Studio 2019 cannot detect that my working directory is the app folder. That's why it showing the python import is unresolved.

Image of the error

Am I doing something wrong in the launch.vs.json file? How can I solve this?

I am using the latest version of Visual Studio 2019.

Do your career a big favor. Join DEV. (The website you're on right now)

It takes one minute, it's free, and is worth it for your career.

Get started

Community matters

Top comments (1)

Collapse
 
instinct profile image
Instinct

Please help #help

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay