How to render Django form errors not in a UL?

后端 未结 2 1139
無奈伤痛
無奈伤痛 2020-12-23 11:16

The errors in my Django form are rendering in a UL as per the docs...

Django

{{ form.non_field_errors }}

HTML



        
2条回答
  •  时光说笑
    2020-12-23 12:03

    You can display your error as the following in your template:

    {{ form.fieldname.errors.as_text }}

提交回复
热议问题