from django.contrib.auth.models import User
from django.db import models
class UserProfile(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
profile_picture = models.ImageField(upload_to='profile_pics/')
bio = models.TextField()
# Add more fields as needed
# To retrieve the user profile:
try:
user_profile = UserProfile.objects.get(user=request.user)
except UserProfile.DoesNotExist:
user_profile = None
if user_profile:
# Access user profile data here