• Как решить ошибку TypeError at / 'set' object is not reversible?

    @Yozz Автор вопроса
    Спасибо вам большое, пересмотрел внимательней юрлы, проблема была в кавычке, в банальной кавычке, искал неделю, благодаря вашему комментарию пересмотрел и нашел, не знаю как могло поменять [] на {}
    и почему не было этого в отчете об ошибке, джанго писал что ошибка была вообще в HTML файле
  • Как решить ошибку TypeError at / 'set' object is not reversible?

    @Yozz Автор вопроса
    Миша Тарасов, 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 : Навигация
    19 :

    • 20 :
    Главная
    21 : Про нас
    22 : Новости
    23 : Контакты
    24 : Добавить запись
    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
  • Как решить ошибку TypeError at / 'set' object is not reversible?

    @Yozz Автор вопроса
    Сергей Горностаев, 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 : Навигация
    19 :

    • 20 :
    Главная
    21 : Про нас
    22 : Новости
    23 : Контакты
    24 : Добавить запись
    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