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

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay