/admin/ 'set' 对象的类型错误是不可逆的

-2 typeerror django-admin

环境:

请求方式:GET 请求地址:http : //127.0.0.1 : 8000/admin/

Django 版本:1.10.6 Python 版本:3.6.0 已安装的应用程序:['music.apps.MusicConfig'、'django.contrib.admin'、'django.contrib.auth'、'django.contrib.contenttypes'、'django .contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles'] 安装的中间件:['django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django .middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middlesiddleFrameOptions ']

追溯:

文件“C:\Users\Dell Laptop\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django-1.10.6-py3.6.egg\django\core\handlers\exception.py”在内部 42. response = get_response(request)

文件“C:\Users\Dell Laptop\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django-1.10.6-py3.6.egg\django\core\handlers\base.py”在 _legacy_get_response 249. response = self._get_response(request)

文件“C:\Users\Dell Laptop\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django-1.10.6-py3.6.egg\django\core\handlers\base.py”在_get_response 187. response = self.process_exception_by_middleware(e, request)

文件“C:\Users\Dell Laptop\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django-1.10.6-py3.6.egg\django\core\handlers\base.py”在_get_response 185.响应=wrapped_callback(请求,*callback_args,**callback_kwargs)

文件“C:\Users\Dell Laptop\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django-1.10.6-py3.6.egg\django\contrib\admin\sites.py”在包装器 229 中。返回 self.admin_view(view, cacheable)(*args, **kwargs)

_wrapped_view 中的文件“C:\Users\Dell Laptop\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django-1.10.6-py3.6.egg\django\utils\decorators.py” 149. response = view_func(request, *args, **kwargs)

文件“C:\Users\Dell Laptop\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django-1.10.6-py3.6.egg\django\views\decorators\cache.py”在 _wrapped_view_func 57. response = view_func(request, *args, **kwargs)

文件“C:\Users\Dell Laptop\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django-1.10.6-py3.6.egg\django\contrib\admin\sites.py”在内部 211. return view(request, *args, **kwargs)

文件“C:\Users\Dell Laptop\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django-1.10.6-py3.6.egg\django\views\decorators\cache.py”在 _wrapped_view_func 57. response = view_func(request, *args, **kwargs)

文件“C:\Users\Dell Laptop\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django-1.10.6-py3.6.egg\django\contrib\admin\sites.py”在索引 468 中。 app_list = self.get_app_list(request)

文件“C:\Users\Dell Laptop\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django-1.10.6-py3.6.egg\django\contrib\admin\sites.py”在 get_app_list 451. app_dict = self._build_app_dict(request)

文件“C:\Users\Dell Laptop\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django-1.10.6-py3.6.egg\django\contrib\admin\sites.py”在 _build_app_dict 418.model_dict['admin_url'] = reverse('admin:%s_%s_changelist' % info, current_app=self.name)

文件“C:\Users\Dell Laptop\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django-1.10.6-py3.6.egg\django\urls\base.py”反向60. app_list = resolver.app_dict[ns]

app_dict 中的文件“C:\Users\Dell Laptop\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django-1.10.6-py3.6.egg\django\urls\resolvers.py” 256. self._populate()

_populate 中的文件“C:\Users\Dell Laptop\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django-1.10.6-py3.6.egg\django\urls\resolvers.py” 209.对于pattern.reverse_dict中的名称:

文件 "C:\Users\Dell Laptop\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django-1.10.6-py3.6.egg\django\urls\resolvers.py" in reverse_dict 242. self._populate()

_populate 中的文件“C:\Users\Dell Laptop\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django-1.10.6-py3.6.egg\django\urls\resolvers.py” 196.对于反转模式(self.url_patterns):

异常类型:TypeError at /admin/ 异常值:'set' 对象不可逆

小智 6

在您的网址中将 {} 括号更改为 [] 这些