title: Display date of birth in django app
body: <p>How to display age from dob obtained? Any suggestion?</p>
  
  <p>models.py </p>
  
  <pre><code>from django.db import models
  import datetime
  
  dob = models.DateField(max_length=8)
  age = models.IntegerField() 
  def __str__(self):
      today = date.today()
          age = today.year - dob.year
      if today.month &lt; dob.month or today.month == dob.month and today.day &lt; dob.day:
          age -= 1
      return self.age 
  </code></pre>
  
  <p>Thank you,
  Rads</p>