Python 不符合';t引用我的代码-显然是在模板中
django项目的错误日志显示以下错误:Python 不符合';t引用我的代码-显然是在模板中,python,django,Python,Django,django项目的错误日志显示以下错误: Exception while resolving variable 'non_field_errors' in template 'admin/change_list.html'. Traceback (most recent call last): File "/home/elections/venv/lib/python3.6/site-packages/django/template/base.py", line 882, in _resol
Exception while resolving variable 'non_field_errors' in template 'admin/change_list.html'.
Traceback (most recent call last):
File "/home/elections/venv/lib/python3.6/site-packages/django/template/base.py", line 882, in _resolve_lookup
current = current[bit]
TypeError: 'NoneType' object is not subscriptable
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/elections/venv/lib/python3.6/site-packages/django/template/base.py", line 890, in _resolve_lookup
current = getattr(current, bit)
AttributeError: 'NoneType' object has no attribute 'non_field_errors'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/elections/venv/lib/python3.6/site-packages/django/template/base.py", line 896, in _resolve_lookup
current = current[int(bit)]
ValueError: invalid literal for int() with base 10: 'non_field_errors'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/elections/venv/lib/python3.6/site-packages/django/template/base.py", line 903, in _resolve_lookup
(bit, current)) # missing attribute
django.template.base.VariableDoesNotExist: Failed lookup for key [non_field_errors] in 'None'
这似乎没有引用我的任何代码,因为我不知道异常是在哪里产生的,我不知道如何防止它。它似乎引用了Django的模板语言,但我不确定是什么。有人知道什么会触发此错误吗?共享您的表单和视图。@vishes\u shell这是数百行代码。。。我是否应该在我的表单和视图中查找可能导致错误的内容?“admin/change\u list.html”是什么样的?是的,自定义表单验证。@Jus我不知道,它不是我的文件。