I am currently developing a Django app using Docker and VSCode.
To start my development server, I run docker compose up, and write code on my VSCode. There is nothing wrong with the functionality of my app, but I sometimes need to look into package source codes using VSCode's "Go To Definition" right-click menu.
This had worked before when I was using venvs, since I was specifying "python.defaultInterpreterPath" to my venv path in my VSCode settings.json.
When I am using Docker, the packages live in my container, so naturally VSCode cannot find go to code definitions for imported packages. As an added downside, it also reports missing import errors.
Right now, I am maintaining a venv folder my machine on top of the packages inside my container, and by pointing "python.defaultInterpreterPath" to this venv, I can overcome both of the problems.
However, this does seem like a bit of extra work, since if I want to install a new package, I have to install both to my venv and my container.
Is there a better way to handl this situation?