  
  
  @python_2_unicode_compatible
  class Profile(models.Model):
      user = models.ForeignKey('auth.User', 'username')
  
      def __str__(self):
          return self.user.username
 
</s> remove     user = models.ForeignKey(User, to_field="username")
 </s> add     user = models.ForeignKey(User, models.CASCADE, to_field="username") </s> remove     user = models.ForeignKey(User, unique=True, to_field="username")
 </s> add     user = models.ForeignKey(User, models.CASCADE, unique=True, to_field="username") </s> remove     poet = models.ForeignKey(Poet)
 </s> add     poet = models.ForeignKey(Poet, models.CASCADE) </s> remove     plot = models.OneToOneField(Plot)
 </s> add     plot = models.OneToOneField(Plot, models.CASCADE) </s> remove     country = models.ForeignKey(Country)
 </s> add     country = models.ForeignKey(Country, models.CASCADE)
    user = models.ForeignKey('auth.User', models.CASCADE, to_field='username')
  
  
  @python_2_unicode_compatible
  class Profile(models.Model):
    user = models.ForeignKey('auth.User', models.CASCADE, to_field='username')
  
      def __str__(self):
          return self.user.username
keep keep keep keep replace keep keep keep
 Fixed #21127 -- Started deprecation toward requiring on_delete for ForeignKey/OneToOneField 
tests/admin_widgets/models.py