Это ошибка, которую я получаю при попытке изменить расширенные настройки страницы в режиме администратора:
TypeError at /admin/cms/page/5/advanced-settings/
__str__ returned non-string (type __proxy__)
Environment:
Request Method: GET
Request URL: http://localhost:8000/admin/cms/page/5/advanced-settings/?language=en&cms_path=/
Django Version: 2.1.7
Python Version: 3.6.7
Installed Applications:
['djangocms_admin_style',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.admin',
'django.contrib.sites',
'django.contrib.sitemaps',
'django.contrib.staticfiles',
'django.contrib.messages',
'cms',
'menus',
'sekizai',
'treebeard',
'djangocms_text_ckeditor',
'filer',
'easy_thumbnails',
'djangocms_column',
'djangocms_file',
'djangocms_link',
'djangocms_picture',
'djangocms_style',
'djangocms_snippet',
'djangocms_googlemap',
'djangocms_video',
'structuresend']
Installed Middleware:
['cms.middleware.utils.ApphookReloadMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'cms.middleware.user.CurrentUserMiddleware',
'cms.middleware.page.CurrentPageMiddleware',
'cms.middleware.toolbar.ToolbarMiddleware',
'cms.middleware.language.LanguageCookieMiddleware']
Template error:
In template /usr/local/lib/python3.6/dist-packages/django/forms/templates/django/forms/widgets/select_option.html, error at line 1
__str__ returned non-string (type __proxy__)
1 : <option value="{{ widget.value|stringformat:'s' }}"{% include "django/forms/widgets/attrs.html" %}> {{ widget.label }} </option>
2 :
Traceback:
File "/usr/local/lib/python3.6/dist-packages/django/core/handlers/exception.py" in inner
34. response = get_response(request)
File "/usr/local/lib/python3.6/dist-packages/django/core/handlers/base.py" in _get_response
156. response = self.process_exception_by_middleware(e, request)
File "/usr/local/lib/python3.6/dist-packages/django/core/handlers/base.py" in _get_response
154. response = response.render()
File "/usr/local/lib/python3.6/dist-packages/django/template/response.py" in render
106. self.content = self.rendered_content
File "/usr/local/lib/python3.6/dist-packages/django/template/response.py" in rendered_content
83. content = template.render(context, self._request)
File "/usr/local/lib/python3.6/dist-packages/django/template/backends/django.py" in render
61. return self.template.render(context)
File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render
171. return self._render(context)
File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in _render
163. return self.nodelist.render(context)
File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render
937. bit = node.render_annotated(context)
File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render_annotated
904. return self.render(context)
File "/usr/local/lib/python3.6/dist-packages/django/template/loader_tags.py" in render
150. return compiled_parent._render(context)
File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in _render
163. return self.nodelist.render(context)
File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render
937. bit = node.render_annotated(context)
File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render_annotated
904. return self.render(context)
File "/usr/local/lib/python3.6/dist-packages/django/template/loader_tags.py" in render
150. return compiled_parent._render(context)
File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in _render
163. return self.nodelist.render(context)
File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render
937. bit = node.render_annotated(context)
File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render_annotated
904. return self.render(context)
File "/usr/local/lib/python3.6/dist-packages/django/template/loader_tags.py" in render
150. return compiled_parent._render(context)
File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in _render
163. return self.nodelist.render(context)
File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render
937. bit = node.render_annotated(context)
File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render_annotated
904. return self.render(context)
File "/usr/local/lib/python3.6/dist-packages/django/template/loader_tags.py" in render
62. result = block.nodelist.render(context)
File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render
937. bit = node.render_annotated(context)
File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render_annotated
904. return self.render(context)
File "/usr/local/lib/python3.6/dist-packages/django/template/defaulttags.py" in render
209. nodelist.append(node.render_annotated(context))
File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render_annotated
904. return self.render(context)
File "/usr/local/lib/python3.6/dist-packages/django/template/loader_tags.py" in render
188. return template.render(context)
File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render
173. return self._render(context)
File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in _render
163. return self.nodelist.render(context)
File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render
937. bit = node.render_annotated(context)
File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render_annotated
904. return self.render(context)
File "/usr/local/lib/python3.6/dist-packages/django/template/loader_tags.py" in render
150. return compiled_parent._render(context)
File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in _render
163. return self.nodelist.render(context)
File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render
937. bit = node.render_annotated(context)
File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render_annotated
904. return self.render(context)
File "/usr/local/lib/python3.6/dist-packages/django/template/defaulttags.py" in render
209. nodelist.append(node.render_annotated(context))
File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render_annotated
904. return self.render(context)
File "/usr/local/lib/python3.6/dist-packages/django/template/defaulttags.py" in render
209. nodelist.append(node.render_annotated(context))
File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render_annotated
904. return self.render(context)
File "/usr/local/lib/python3.6/dist-packages/django/template/defaulttags.py" in render
309. return nodelist.render(context)
File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render
937. bit = node.render_annotated(context)
File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render_annotated
904. return self.render(context)
File "/usr/local/lib/python3.6/dist-packages/django/template/defaulttags.py" in render
309. return nodelist.render(context)
File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render
937. bit = node.render_annotated(context)
File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render_annotated
904. return self.render(context)
File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render
993. return render_value_in_context(output, context)
File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render_value_in_context
972. value = str(value)
File "/usr/local/lib/python3.6/dist-packages/django/utils/html.py" in <lambda>
397. klass.__str__ = lambda self: mark_safe(klass_str(self))
File "/usr/local/lib/python3.6/dist-packages/django/forms/boundfield.py" in __str__
33. return self.as_widget()
File "/usr/local/lib/python3.6/dist-packages/django/forms/boundfield.py" in as_widget
93. renderer=self.form.renderer,
File "/usr/local/lib/python3.6/dist-packages/django/forms/widgets.py" in render
230. return self._render(self.template_name, context, renderer)
File "/usr/local/lib/python3.6/dist-packages/django/forms/widgets.py" in _render
235. return mark_safe(renderer.render(template_name, context))
File "/usr/local/lib/python3.6/dist-packages/django/forms/renderers.py" in render
31. return template.render(context, request=request).strip()
File "/usr/local/lib/python3.6/dist-packages/django/template/backends/django.py" in render
61. return self.template.render(context)
File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render
171. return self._render(context)
File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in _render
163. return self.nodelist.render(context)
File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render
937. bit = node.render_annotated(context)
File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render_annotated
904. return self.render(context)
File "/usr/local/lib/python3.6/dist-packages/django/template/defaulttags.py" in render
209. nodelist.append(node.render_annotated(context))
File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render_annotated
904. return self.render(context)
File "/usr/local/lib/python3.6/dist-packages/django/template/defaulttags.py" in render
209. nodelist.append(node.render_annotated(context))
File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render_annotated
904. return self.render(context)
File "/usr/local/lib/python3.6/dist-packages/django/template/loader_tags.py" in render
188. return template.render(context)
File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render
173. return self._render(context)
File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in _render
163. return self.nodelist.render(context)
File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render
937. bit = node.render_annotated(context)
File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render_annotated
904. return self.render(context)
File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render
993. return render_value_in_context(output, context)
File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render_value_in_context
972. value = str(value)
Exception Type: TypeError at /admin/cms/page/5/advanced-settings/
Exception Value: __str__ returned non-string (type __proxy__)
Кажется, проблема в том, что value = str(value)
не возвращает строку, хотя значениеназывается «Унаследовать шаблон ближайшего предка».Я не уверен, что здесь происходит.
Очевидно, он возвращает тип __proxy__
, который, согласно другим вопросам, является типом, используемым для перевода.Что я могу сделать, чтобы это исправить?Мне нужен доступ к настройкам моей страницы, чтобы изменить используемый html-шаблон.