title: Django - create profile for all existing users
body: <p>i'm using Django 3 , this is my userprofile model </p>
  
  <pre><code>from django.db import models
  from django.contrib.auth.models import User
  from datetime import datetime
  from django.db.models.signals import post_save
  from django.utils.text import slugify 
  from django.db.models import signals
  
  # Create your models here.
  
  class Profile(models.Model):
      user = models.OneToOneField(User, on_delete=models.CASCADE)
      bio = models.TextField(max_length=1000,blank=True)
      created_at = models.DateTimeField(default=datetime.now())
      slug = models.SlugField(blank=True)
      img = models.ImageField(upload_to='userimg/',default='userimg/avatar.png')
  
      def __str__(self):
          return "%s" % self.user
  
      def save(self, *args, **kwargs):
          self.slug = slugify(self.user)
          super(Profile, self).save(*args, **kwargs)
  
  def create_user_profile(sender, instance, created, **kwargs):
      if created:
          Profile.objects.get(user=instance)
  
  post_save.connect(create_user_profile, sender=User)
  
  def delete_user(sender, instance=None, **kwargs):
      try:
          instance.user
      except User.DoesNotExist:
          pass
      else:
          instance.user.delete()
  
  signals.post_delete.connect(delete_user, sender=Profile)
  </code></pre>
  
  <p>the problem is that the function create_user_profile create profiles only for the new users but doesn't create for the old users , so how can i fix that ?</p>