[Answer]-Hiding a ModelForm field entry in Django

1👍

If you have a custom template and view you may exclude the field and use

 {{ modelform.instance.field }} 

to get the value.

also you may prefer to use in the view:

form.fields['field_name'].widget = forms.HiddenInput()

It also can be useful:

{{ form.field.as_hidden }}

Leave a comment