Rendering Form Fields

What is the Difference between this renderings

  1. {{ form.mobile }}
  2. {% render_field form.mobile %}

and is this usage valid:

{% render_field form.mobile required %}

There is no django-provided template tag called render_field.

You would need to check with whatever package you’re using that is providing it to determine how it may be different from directly rendering the field.

thank you for reply.

tag provided by package django-widget-tweaks to render forms fields.

it works so fine to pass html attributes into rendered input.
as example we can do something like this.

{% render_field form.mobile class="btn btn-danger" required %}