Как работает модель User с отношениями one2one? Django [закрыто]

I often see people using the user field with the one2one connection to the user model. But which model should I refer to now to create a form, log in, log out, confirm access and everything related to the user? How does the user model work in general?

class Profile(models.Model):
    GENDER_CHOICES = {
        ('M', 'Male'),
        ('F', 'Female')
    }

    user = models.OneToOneField(User, on_delete=models.CASCADE)
    age = models.IntegerField(
        validators=[MinValueValidator(1), MaxValueValidator(150)], null=True, blank=True)
    about_me = models.TextField(max_length=500, null=True, blank=True)
    gender = models.CharField(max_length=1, choices=GENDER_CHOICES, null=True, blank=True)
    photo = models.ImageField(upload_to='profile_photos/', null=True, blank=True)

Я пытался найти ответ в Google, но не смог найти решение

Вернуться на верх