using django form to make a read only html view code example
Example: set form field disabled django
class PatientForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super(PatientForm, self).__init__(*args, **kwargs)
self.fields['field'].widget.attrs['readonly'] = True
class Meta:
model = Patient