错误没有引用我的代码 - 显然是在模板中

时间:2018-03-04 13:23:26

标签: 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 _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的模板语言有关的东西,但我不确定是什么。有谁知道什么会触发这个错误?

0 个答案:

没有答案