Pylint, undefined, import, defined, module, errors.

Greetings Django Community,

I’m struggling with this 9 errors, I don’t understand what’s happening and can’t find any solution in stacks, documentation, discord, djangogirls or google.

I have rebuilded this project 6 times and have done it a little bit different in the last 5 days, I have a little bit of knowledge on python and django, very new and basic to this code world.

PROBLEMS

urls.py …/d_project

from django.contrib import admin
from django.urls import path

urlpatterns = [
path(‘admin/’, admin.site.urls),
path(‘blog/’, include(‘blog.urls’)),
]

urls.py …/blog

from django.urls import path
from . import views

urlpatterns = [
path(‘’, views.home, name=‘blog-home’),
path(‘about/’, views.about, name=‘blog-about’),
]

tests.py

from django.test import TestCase

views.py

from django.shortcuts import render
from django.http import HttpResponse

def home (request):
return HttpResponse(‘

Blog Home

’),

def home (request):
return HttpResponse(‘

Blog About

’),

PICTURES

Thank you for your time and help

You didn’t import include “include” in your urls.py in d_project. Put this on top.

from django.urls import include

And in your views you have two function with the same name “home”. I think second one should be “about” :smiley:

1 Like

Thanks Bachi-code, you won’t be forgotten