title: After I made a migration I get this error RelatedObjectDoesNotExist at /admin/login/ User has no profile
body: <p>I just start to learn django. I want to create a bookmanager. First time I will create Model Book, after this I create users and after this I create another model Categories. After this migration I get the error RelatedObjectDoesNotExist at /admin/login/ User has no profile.
  I can acces the old users profile, but I cannot create new and cannot access it's profile. Also I cannot access the admin.</p>
  <p>How can I resolve the problem.</p>
  <p>models.py</p>
  <pre><code>from django.contrib.auth.models import User
  from PIL import Image
  
  # Create your models here.
  class Profile(models.Model):
      user = models.OneToOneField(User, on_delete=models.CASCADE)
      image = models.ImageField(default='person.jpg', upload_to='profile_pics')
  
      def __str__(self):
          return f'{self.user.username} Profile'
  
      def save(self):
          super().save()
  
          img = Image.open(self.image.path)
  
          if img.height &gt; 500 or img.width &gt; 500:
              output_size = (500, 500)
              img.thumbnail(output_size)
              img.save(self.image.path)
  </code></pre>
  <p>signals.py</p>
  <pre><code>from django.db.models.signals import post_save
  from django.contrib.auth.models import User
  from django.dispatch import receiver
  from .models import Profile
  
  @receiver(post_save, sender=User)
  def create_profile(sender, instance, created, **kwards):
      user = instance
      if created:
          Profile.objects.create(user=user)
  
  
  @receiver(post_save, sender=User)
  def save_profile(sender, instance, **kwards):
      instance.profile.save()
  </code></pre>