/ admin /'set'对象的TypeError是不可逆的 [英] TypeError at /admin/ 'set' object is not reversible

查看:158
本文介绍了/ admin /'set'对象的TypeError是不可逆的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

环境:

请求方法:GET请求网址: http://127.0.0.1:8000/admin/

Request Method: GET Request URL: 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.middleware.clickjacking.XFrameOptionsMiddleware]

Django Version: 1.10.6 Python Version: 3.6.0 Installed Applications: ['music.apps.MusicConfig', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles'] Installed Middleware: ['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.middleware.clickjacking.XFrameOptionsMiddleware']

追溯:

文件 C:\UsersDell Laptop\AppData\Local\Programs\Python\Python36-32\lib\ site-packages\django-1.10.6-py3.6.egg\内部42中的 django\core\handlers\exception.py。response = get_response(request)

File "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" in inner 42. response = get_response(request)

文件 C:\Users\Dell Laptop \AppData\Local\程序\Python\Python36-32\lib\站点软件包\django-1.10.6-py3.6.egg\django\core\handlers\base _legacy_get_response 249中的 .py。response = self._get_response(request)

File "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" in _legacy_get_response 249. response = self._get_response(request)

文件 C:\Users\Dell Laptop\AppData\Local\Programs _get_response 187中的 Python Python36-32库站点包 django-1.10.6-py3.6.egg django核心处理程序 base.py。response = self.process_exception_by_middleware(e,request)

File "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" in _get_response 187. response = self.process_exception_by_middleware(e, request)

文件 C:\Users\Dell Laptop\AppData\Local\Programs\Python\Python36- _get_response 185中的32个 lib-site-packagesdjango-1.10.6-py3.6.eggdjango\core\handlersbase.py。response = wrapd_callback(request,* callback_args, ** callback_kwargs)

File "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" in _get_response 185. response = wrapped_callback(request, *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\cont包装229中的 rib\admin\sites.py。返回self.admin_view(view,cacheable)(* args,** kwargs)

File "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" in wrapper 229. return self.admin_view(view, cacheable)(*args, **kwargs)

文件 C: \用户\戴尔笔记本电脑\AppData\本地\程序\Python\Python36-32\库\站点软件包\django-1.10.6-py3.6.egg\django\ _wrapped_view 149中的utils\decorators.py。response = view_func(request,* args,** kwargs)

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

文件 C:\Users\Dell Laptop \AppData\Local\程序\Python\Python36-32\lib\站点软件包\django-1.10.6-py3.6.egg\django\视图\装饰器\缓存_wrapped_view_func 57中的 .py。response = view_func(request,* args,** kwargs)

File "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" in _wrapped_view_func 57. response = view_func(request, *args, **kwargs)

文件 C:\Users\Dell Laptop\AppData\ \本地\程序\Python\Python36-32\lib\站点包\django-1.10.6-py3.6.egg\django\contrib\admin\sites.py内部211。返回视图(请求,* args,** kwargs)

File "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" in inner 211. return view(request, *args, **kwargs)

文件 C:\Users\Dell Laptop\AppData\Local\Programs _wrapped_v中的 Python Python36-32库站点包 django-1.10.6-py3.6.egg django视图 decorators cache.py iew_func57。response = view_func(request,* args,** kwargs)

File "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" in _wrapped_view_func 57. response = view_func(request, *args, **kwargs)

文件 C:\Users\Dell Laptop\AppData\Local\程序索引468中的 ​​Python Python Python36-32 lib站点包 django-1.10.6-py3.6.egg django contrib admin sites.py。app_list = self.get_app_list(request)

File "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" in index 468. app_list = self.get_app_list(request)

文件 C:\Users\Dell Laptop\AppData\Local\Programs\Python\Python36-32 get_app_list 451中的 libsitesitepackagesdjango-1.10.6-py3.6.eggdjangocontrib\admin\sites.py。app_dict = self._build_app_dict(request)

File "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" in get_app_list 451. app_dict = self._build_app_dict(request)

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

File "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" in _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 库站点包 django-1.10.6-py3.6.egg django urls base.py中的第60段。反之。app_list = r esolver.app_dict [ns]

File "C:\Users\Dell Laptop\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django-1.10.6-py3.6.egg\django\urls\base.py" in reverse 60. app_list = resolver.app_dict[ns]

文件 C:\Users\Dell Laptop\AppData\Local\Programs\Python\Python36-32\ app_dict 256中的 libsite-packagesdjango-1.10.6-py3.6.eggdjangoURLsresolvers.py。self._populate()

File "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 app_dict 256. self._populate()

文件 C:\UsersellDell Laptop\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django-1.10.6- pypop.209中的py3.6.egg\django\urls\resolvers.py,用于pattern.reverse_dict中的名称:

File "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 _populate 209. for name in pattern.reverse_dict:

文件 C:\Users \Dell Laptop\AppData\Local\程序\Python\Python36-32\lib\站点软件包\django-1.10.6-py3.6.egg\django\urls\ reverse_dict 242中的resolvers.py。self._populate()

File "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()

文件 C:\Users\Dell Laptop\AppData\Local\Programs\ _populate 196中的Python\Python36-32\lib\site-packages\django-1.10.6-py3.6.egg\django\urls\resolvers.py。 url_patterns):

File "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 _populate 196. for pattern in reversed(self.url_patterns):

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

Exception Type: TypeError at /admin/ Exception Value: 'set' object is not reversible

推荐答案

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

in your urls change {} brackets to [] these

这篇关于/ admin /'set'对象的TypeError是不可逆的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆