Home > OS >  import "django.shortcuts" could not be resolved from sauce Pylance(reportMissingModuleSouc
import "django.shortcuts" could not be resolved from sauce Pylance(reportMissingModuleSouc

Time:11-07

[![import "django.shortcuts" could not be resolved from sauce Pylance(reportMissingModuleSoucre)

from django.shortcuts import render

# Create your views here.
def get_home(request):
    return render(request,'home.html')

i didnt try anything,i need some help

CodePudding user response:

add the extra path virtual env - Django installed/lib/sitepackages to workspace of visual studio code in settings refer this img -

CodePudding user response:

You need to make sure you have selected the correct python interpreter (shortcuts "Ctrl shift P" and type "Python: Select Interpreter") which you have installed the packages you want to import.

Or you can reinstall the packages under the python interpreter which you have selected in the VSCode.

  • Related