from django.db import models from django.contrib.auth.models import AbstractUser class User(AbstractUser): pass class Meta: ordering = ['-date_joined'] class UserProfile(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) photo = models.ImageField(upload_to='profile', null=True, blank=True) website = models.CharField(max_length=300, null=True, blank=True, default='') location = models.CharField(max_length=300, null=True, blank=True, default='') bio = models.TextField(null=True, blank=True, default='') def __str__(self): return self.user.username