Python Django错误类型错误位于/admin/';设置';对象是不可逆的

Python Django错误类型错误位于/admin/';设置';对象是不可逆的,python,django,Python,Django,我刚刚学习了Django,我正在关注网站上的“编写你的第一个Django应用程序”。但是当我谈到Django管理部分时,我犯了一个错误 TypeError at /admin/ 'set' object is not reversible Request Method: GET Request URL: http://localhost:8000/admin/ Django Version: 3.0.2 Exception Type: TypeError Exception Value:

我刚刚学习了Django,我正在关注网站上的“编写你的第一个Django应用程序”。但是当我谈到Django管理部分时,我犯了一个错误

TypeError at /admin/
'set' object is not reversible
Request Method: GET
Request URL:    http://localhost:8000/admin/
Django Version: 3.0.2
Exception Type: TypeError
Exception Value:    
'set' object is not reversible
Exception Location: D:\python\lib\site-packages\django\urls\resolvers.py in _populate, line 455
Python Executable:  D:\python\python.exe
Python Version: 3.8.1
Python Path:    
['D:\\python\\projek\\mysite',
 'D:\\python\\python38.zip',
 'D:\\python\\DLLs',
 'D:\\python\\lib',
 'D:\\python',
 'D:\\python\\lib\\site-packages']
Server time:    Sat, 1 Feb 2020 08:37:20 +0000
我意识到,正如教程所说,当我向url.py文件添加新路径时,会出现错误

这是我的URL.py代码

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

urlpatterns = [
    path('polls/', include('polls.urls')), <<---- This is the problem
    path('admin/', admin.site.urls),
]
来自django.contrib导入管理
从django.url导入包括,路径
URL模式=[

路径('polls/',include('polls.url'),将url模式更改为

urlpatterns = [
    # ex: /polls/
    path('', views.index, name='index'),
    # ex: /polls/5/
    path('<int:question_id>/detail/', views.detail, name='detail'),
    # ex: /polls/5/results/
    path('<int:question_id>/results/', views.results, name='results'),
    # ex: /polls/5/vote/
    path('<int:question_id>/vote/', views.vote, name='vote'),
]
urlpatterns=[
#例如:投票/
路径(“”,views.index,name='index'),
#ex:/polls/5/
路径('/detail/',views.detail,name='detail'),
#ex:/polls/5/结果/
路径('/results/',views.results,name='results'),
#ex:/polls/5/投票/
路径('/vote/',views.vote,name='vote'),
]

您必须使用方括号而不是花括号,并以这样的方式制作图案,使其不会重叠also@bmons我已经添加了polls/url.pyurlpatterns是一个列表而不是一个格言哦,天哪,我不知道我用错了括号,非常感谢。
urlpatterns = [
    # ex: /polls/
    path('', views.index, name='index'),
    # ex: /polls/5/
    path('<int:question_id>/detail/', views.detail, name='detail'),
    # ex: /polls/5/results/
    path('<int:question_id>/results/', views.results, name='results'),
    # ex: /polls/5/vote/
    path('<int:question_id>/vote/', views.vote, name='vote'),
]