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.

Please leave your appreciation by commenting on this post!

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

Let's go

Top comments (1)

Collapse
 
instinct profile image
Instinct

Please help #help

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay