Hello. Just started picking up Django and already stalled.
The directory organization is as follows:
Testproject - manage.py - blog --urls.py --views.py --... -testproject --urls.py --... Content /blog/views.py:
from django.shortcuts import render from django.http import HttpResponse # Create your views here. def index(request): return HttpResponse("Hello, world.") Content /blog/urls.py
from django.urls import path from . import views urlpatterns = [ path('', views.index, name='index'), ] Content /testproject/urls.py
from django.contrib import admin from django.urls import path, include urlpatterns = [ path('admin/', admin.site.urls), path('test/', include(blog.urls)) ] Swears that
File "~/testproject/testproject/urls.py", line 21, in <module> path('test/', include(blog.urls)) NameError: name 'blog' is not defined It seems to do everything on the guidelines. What is the problem, why Include me does not understand?