title: What is doing __str__ function in Django?
body: <p>I'm reading and trying to understand django documentation so I have a logical question.</p>
  
  <p>There is my <code>models.py</code> file</p>
  
  <pre><code>from django.db import models
  
  # Create your models here.
  
  
  class Blog(models.Model):
      name = models.CharField(max_length=255)
      tagline = models.TextField()
  
      def __str__(self):
          return self.name
  
  
  
  class Author(models.Model):
      name = models.CharField(max_length=255)
      email = models.EmailField()
  
      def __str__(self):
          return self.name
  
  
  
  class Post(models.Model):
      blog = models.ForeignKey(Blog)
      headline = models.CharField(max_length=255)
      body_text = models.TextField()
      pub_date = models.DateField()
      mod_date = models.DateField()
      authors = models.ManyToManyField(Author)
      n_comments = models.IntegerField()
      n_pingbacks = models.IntegerField()
      rating = models.IntegerField()
  
      def __str__(self):
          return self.headline
  </code></pre>
  
  <p>What is doing here each <code>__str__</code> function in each class? 
  What is the reason I need those functions in it?</p>