I have a Django project called ubm-app
with two apps, main
and ubm-app
. I've created a couple of classes, URLAdder
and URLModifier
in the views.py
file in the main
app. Im trying to import these views into my urls.py
file by using the line from . import views
but VS Code shows me the error unresolved import 'c:\Users\Hari\Desktop\django\UBM-App\main.'
.
This is my urls.py
file.
from django.urls import path, include
from . import views
urlpatterns = [
path('',views.home,name='home'),
path('api/add/', views.URLAdder.as_view()),
path('api/modify/',views.URLModifier.as_view()),
]
This is the settings.json
file found when I use the Configure Language Specific Settings...
option.
{
"C_Cpp.updateChannel": "Insiders",
"[python]": {
}
}
This is the settings.json
file in the .vscode
folder in my Django project.
{
"python.pythonPath": "env\\Scripts\\python.exe"
}
Can anyone please suggest a fix to this with an explanation? I seem to be having these unresolved import errors time and again. Forgive me if the error is a basic one.