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.

Reinvent your career. Join DEV.

It takes one minute and is worth it for your career.

Get started

Top comments (1)

Collapse
 
instinct profile image
Instinct

Please help #help

👋 Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay