[Answer]-Django: How to render form field by html_name

1👍

form.fields holds the form.Field instances. You want the BoundField instances, which are accessible directly from the form instance using key access (in Python code) or dotted access (in template code). IOW:

in python:

form["approve"]

in templates :

{{ form.approve }}

Now note that it’s not the html_name you have to use but the field name.

Leave a comment