AttributeError:模块“ calc.views”没有属性“ home”

时间:2019-10-01 15:28:45

标签: django python-3.x

我知道已经问了一些问题,但是没有一个对我有用 服务器未运行,并且命令抛出此错误

calc urls.py

from django.urls import path

from . import views

urlpatterns = [
    path('',views.home, name='home')
]

calc views.py

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

def home(request):
    return HttpResponse("Hello World !")

saish urls.py

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

urlpatterns = [
    path('', include('calc.urls')),
    path('admin/', admin.site.urls),
]

0 个答案:

没有答案