In Django, when creating a ModelForm
, it is common to use exclude
to remove fields from the form. It is also possible to
set the fields
value to __all__
to conveniently indicate that all the model fields should be included in the form. However,
this can lead to security issues when new fields are added to the model, as they will automatically be included in the form, which may not be
intended. Additionally, exclude
or __all__
can make it harder to maintain the codebase by hiding the dependencies between
the model and the form.