title: Disable Fields from Editing in Django
body: <p>I have a form with several fields that I would like to show to the user but prevent them from editing (should not be an edit box).</p>
  
  <p>My form class looks like this and I'm using the fields meta to have them automatically defined. I'm looking to prevent user from changing their username and email after registration.</p>
  
  <pre><code>class UserEditForm(forms.ModelForm):
      class Meta:
          model = User
          fields = ('username', 'first_name', 'last_name', 'email', 'password')
  </code></pre>
  
  <p>The question <a href="https://stackoverflow.com/questions/324477/in-a-django-form-how-do-i-make-a-field-readonly-or-disabled-so-that-it-cannot/325038#325038">In a Django form, how do I make a field readonly (or disabled) so that it cannot be edited?</a> 
  doesn't provide an answer to what to do if the fields are defined automatically using meta.</p>
  
  <p>I've tried </p>
  
  <pre><code>disabled = ('username', 'email',)
  </code></pre>
  
  <p>And a few other options but nothing seems to work.
  I'm looking to prevent someone from also changing the form and submitting it (and the data getting changed) as the previous question suggested can be done.</p>
  
  <p>[Edit]: Using Django 1.11</p>