text: from __future__ import unicode_literals
  from django.db import models
  from django.contrib.auth.models import User
  from rest_framework.authtoken.models import Token
  from django.db.models.signals import post_save
  from django.dispatch import receiver
  
  class Profile(models.Model):
  
      """Basically we are hooking the
          create_user_profile and save_user_profile
          methods to the User model, whenever a save event occurs.
          This kind of signal is called post_save."""
  
      user = models.OneToOneField(User, on_delete=models.CASCADE)
      bio = models.TextField(max_length=500, blank=True)
      location = models.CharField(max_length=30, blank=True)
      birth_date = models.DateField(null=True, blank=True)
  
  
  @receiver(post_save, sender=User)
  def create_user_profile(sender, instance, created, **kwargs):
      if created:
          Profile.objects.create(user=instance)
  
  
  @receiver(post_save, sender=User)
  def save_user_profile(sender, instance, **kwargs):
      instance.profile.save()
  
  
  @receiver(post_save, sender=User)
  def create_auth_token(sender, instance=None, created=False, **kwargs):
      if created:
          Token.objects.create(user=instance)
  