Y
Y
Yozz2021-07-12 21:52:50
Django
Yozz, 2021-07-12 21:52:50

How to solve TypeError at / 'set' object is not reversible error?

Switch to copy-and-paste view

Environment:

Request Method: GET
Request URL: 127.0.0.1:8000

Django Version: 3.2.4
Python Version: 3.9.5
Installed Applications:
['main',
'news',
'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']

Template error:
In template D:\Different\Python\web-app\ yozz\main\templates\main\layout.html, error at line 20
'set' object is not reversible
10 :
11 :
12 :
13 :
14 :
15 :
16 : logo_simple.svg'%20%25%7D
17 : Yozz
18 : Navigation
19 :


  • 20 :
Home
21 : About us
22 : News
23 : Contacts
24 : Add entry
25 :
26 :
27 :
28 : {% block content %}
29 : {% endblock %}
30 :

Traceback (most recent call last):
File "C: \Users\Yozz\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\handlers\exception.py", line 47, in inner
response = get_response(request)
File "C:\Users\ Yozz\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\handlers\base.py", line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "D:\Different\Python\web-app\yozz\main\views.py", line 8, in index
return render(request, 'main/index. html', data)
File "C:\Users\Yozz\AppData\Local\Programs\Python\Python39\lib\site-packages\django\shortcuts.py", line 19, in render
content = loader.render_to_string(template_name, context, request, using=using)
File "C:\Users\Yozz\AppData\Local\Programs\Python\Python39\lib\site-packages\django\template\loader.py", line 62, in render_to_string
return template. render(context, request)
File "C:\Users\Yozz\AppData\Local\Programs\Python\Python39\lib\site-packages\django\template\backends\django.py", line 61, in render
return self.template.render(context)
File "C:\Users\Yozz\AppData\Local\Programs\Python\Python39\lib\site-packages\django\template\base.py", line 170, in render
return self ._render(context)
File "C:\Users\Yozz\AppData\Local\Programs\Python\Python39\lib\site-packages\django\template\base.py", line 162, in _render
return self.nodelist.render (context)
File "C:\Users\Yozz\AppData\Local\Programs\Python\Python39\lib\site-packages\django\template\base.py", line 938, in render
bit = node.render_annotated(context)
File "C:\Users\Yozz\AppData\Local\Programs\Python\Python39\lib\site-packages\django\template\base.py", line 905, in render_annotated
return self.render(context)
File "C:\Users\Yozz\AppData\Local\Programs\Python\Python39\lib\site-packages\django\template\loader_tags.py", line 150, in render
return compiled_parent._render(context)
File "C: \Users\Yozz\AppData\Local\Programs\Python\Python39\lib\site-packages\django\template\base.py", line 162, in _render
return self.nodelist.render(context)
File "C:\Users \Yozz\AppData\Local\Programs\Python\Python39\lib\site-packages\django\template\base.py", line 938, in render
bit = node.render_annotated(context)
File "C:\Users\Yozz\ AppData\Local\Programs\Python\Python39\lib\site-packages\django\template\base.py", line 905, in render_annotated
return self.render(context)
File "C:\Users\Yozz\AppData\Local\Programs\Python\Python39\lib\site-packages\django\template\defaulttags.py", line 446, in render
url = reverse(view_name, args=args, kwargs =kwargs, current_app=current_app)
File "C:\Users\Yozz\AppData\Local\Programs\Python\Python39\lib\site-packages\django\urls\base.py", line 86, in reverse
return resolver._reverse_with_prefix (view, prefix, *args, **kwargs)
File "C:\Users\Yozz\AppData\Local\Programs\Python\Python39\lib\site-packages\django\urls\resolvers.py", line 627, in _reverse_with_prefix
self._populate()
File "C:\Users\Yozz\AppData\Local\Programs\Python\Python39\lib\site-packages\django\urls\resolvers.py", line 477, in _populate
url_pattern._populate()
File "C:\Users\Yozz\AppData\Local\Programs\Python\Python39\lib\site-packages\django\urls\resolvers.py", line 460, in _populate
for url_pattern in reversed(self.url_patterns):

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

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
alternativshik, 2021-07-13
@Yozz

here to see more urls

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question