定义 url 时,我不断收到一个奇怪的错误:AttributeError at /'tuple' object has no attribute 'get'Request Method: GETRequest URL: http://localhost:51942/Django Version: 2.1.3Exception Type: AttributeErrorException Value: 'tuple' object has no attribute 'get'这是我的网址:from django.contrib import adminfrom django.urls import pathfrom saeed import viewsurlpatterns = [ path('admin/', admin.site.urls), path('', views.index, name="index"),]这是我的观点:from django.shortcuts import renderdef index(request): return render,"index.html"请通知我。谢谢,赛义德
1 回答

跃然一笑
TA贡献1826条经验 获得超6个赞
您应该将视图更改为:
from django.shortcuts import render
def index(request):
return render(request, "index.html")
添加回答
举报
0/150
提交
取消