Do not show certain fields in admin page
<p>In Django, you get the model editor for free in the <code>admin/</code> pages. This all works fine, but I have a few fields in my models that are generated and should never be touched by anybody through a form.</p>

<p>How can I exclude them from these <code>admin/.../change/</code> forms?</p>

<p>I added exclude to the <code>ModelAdmin</code>:</p>

<pre><code>class exampleAdmin(admin.ModelAdmin):
    exclude = ('field',)

class example(models.Model):
    field = models.CharField(max_length = 100)
</code></pre>

<blockquote>
  <p>I have a few fields in my models that are
  generated and should never be touched by anybody through a form.</p>
</blockquote>

<p>You may also use <a href="https://docs.djangoproject.com/en/1.10/ref/models/fields/#editable" rel="nofollow"><code>editable=False</code></a> on your model's field</p>

<blockquote>
  <p><strong><a href="https://docs.djangoproject.com/en/1.10/ref/models/fields/#editable" rel="nofollow">Field.editable</a></strong></p>
  
  <p>If False, the field <strong>will not be displayed in the admin or any other
  ModelForm</strong>. They are also skipped during model validation. Default is
  True.</p>
</blockquote>

<pre><code>class Example(models.Model):
    field = models.CharField(max_length=100, editable=False)
</code></pre>

python django