Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 不符合';t引用我的代码-显然是在模板中_Python_Django - Fatal编程技术网

Python 不符合';t引用我的代码-显然是在模板中

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

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 _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我不知道,它不是我的文件。