How to get form fields' id in Django

Solution 1:

You can get the ID like this:

{{ field.auto_id }}

Solution 2:

You can also use id_for_label:

{{ field.id_for_label }}