from django.urls import path,include import blog.views #这里提示没有views模块 urlpatterns = [ path('hello_world',blog.views.hello_world) ]
可是我在APP中 配置了 views 我是初学希望有大佬解惑
from django.shortcuts import render from django.http import HttpResponse # Create your views here. def hell0_world(request): return HttpResponse('Hello world!')
. views urlpatterns = [ path(views.hello_world)]
def hell0_world(request):
检查名称是否正确,在urls.py中可以import blog.看有没有自动提示