Add a hidden field to a Django Form

How to add a hidden field to a Django Form or a Django ModelForm

Posted May 21, 2018

There are two methods to hide a field in a Django Form, both solutions uses the HiddenInput widget.

If your form is a Django ModelForm, the way to do it is:

If you want to define your Django Form from scratch, the solution is: