django表单错误打印__all__ [英] django form errors prints __all__
本文介绍了django表单错误打印__all__的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
默认登录模板中的以下代码:
This code in the default login template:
{{ form.errors }}
在帐户处于非活动状态时产生此html输出:
Produces this html output when the account is inactive:
<ul class="errorlist">
<li>__all__
<ul class="errorlist">
<li>This account is inactive.</li>
</ul>
</li>
</ul>
为什么打印字符串 _ all _ ?
Why does it print the string _all_?
我正在使用开发版本.
推荐答案
啊,我应该使用:
{{ form.non_field_errors }}
代替
这篇关于django表单错误打印__all__的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文