How do I view the .py source code files instead of .pyi python interface files in Django via VS Code?

Hi there,

I have Python v3.10.6 and Django v4.0.5 installed. I am using VS Code v1.71.0 version for my django apps.

As a convention (standard) when we press and hold Ctrl (in Windows) or Command (in MAC) and click on any module name, it takes us to the Django source code files which have .py extensions and show us the code of that module where we clicked. I used to view the source code of django forms, generic views etc one month back.

I just reinstalled the windows and all softwares in my Computer and have the versions of Python, Django and VS Code which I told at start. Now, whenever I press and hold Ctrl/Command and click on any module, instead of taking me to .py source code file of django, it takes me to .pyi python interface file in Django, which instead of showing the source code, just shows me three dots at the end of every method signature. Look at the screenshot attached below:

Can somebody help me that how can I view the source code as I sued to view earlier?

Hey there!
The stub file pyi is located mostly in the same path as the source code file.
So this file is under: django.contrib.auth.base_user.py
If you are using a virtualvenv the django folder will be within it. If you’re not using any virtual environment, or any tool for dealing with the dependencies, the django package was installed globally, and it may vary on each python installation (This is not the recommended installation method).

I am using virtual environments for all my django apps. What you told, I know that already. I actually want VS Code to open .py file instead of .pyi file when I Ctrl + Click on any method call-reference etc.